/* Home: Editor's Desk. Owned by the desk section agent (homepage 100x work, 2026-09-23, round 2).
   The page's only paper metaphor, now a lit still life: a soft mist desk (the one agreed large
   radius, 18px), a pile of his editorials on a ream, the sheet on top in focus and the ones beneath
   softly out of it, and along the front of the desk every editorial he has written, spread out in
   order like a deck of pages. Pick one and it is pulled out and laid on top, its print comes into
   focus part by part, and the blue pencil underlines its key line. desk.js runs the desk.
   Motion curves are Apple's own, read from apple.com's stylesheets (2026-09-23):
   hover lift  0.3s cubic-bezier(0, 0, 0.5, 1)        (their tiles and cards)
   content     0.5s cubic-bezier(0.28, 0.11, 0.32, 1) (their local nav)
   moves       cubic-bezier(0.4, 0, 0.6, 1)           (their most used curve) */

/* the section clips sideways so a sheet in flight can never make the page scroll sideways */
.desk-sec { overflow-x: clip; }

/* Layout: the desk on the left spans the rows, the headline and the index sit beside it, centred.
   On a phone the headline leads, then the desk, then the index. */
.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: "table ." "table head" "table side" "table .";
  column-gap: clamp(2.5rem, 5.5vw, 5rem);
}
.desk-h { grid-area: head; max-width: 19ch; text-wrap: balance; }
.desk-table { grid-area: table; position: relative; }
.desk-side { grid-area: side; }

/* THE DESK: the ground the paper lies on, so white paper reads as paper and its shadows can land */
.desk-top {
  position: relative;
  /* lit from above: the far side of the desk a breath lighter than the near side */
  background: linear-gradient(180deg, color-mix(in srgb, var(--mist) 55%, var(--paper)) 0%, var(--mist) 55%);
  background-color: var(--mist);
  border-radius: 18px;
  padding: clamp(1.5rem, 3.6vw, 3.25rem) clamp(1rem, 3.2vw, 2.75rem) clamp(1rem, 2.2vw, 1.75rem);
  perspective: 1100px; perspective-origin: 50% -30%; /* we look down onto the desk from above */
}

/* THE PILE: every sheet sits in the same box, posed by its level (0 is the top). The pile is a size
   container: the page sets its type in cqi, so it scales like a printed page. */
.desk-pile {
  --desk-w: min(100%, 25.5rem);
  position: relative; container-type: inline-size;
  width: var(--desk-w); aspect-ratio: 31 / 36;
  margin: 0 auto 3.6rem; /* room for the fanned sheets and the ream beneath */
  /* the pile lies on the desk, seen from above and in front: its far edge recedes. A real 3D stack
     (CSS 3D, not WebGL: the hero owns WebGL). No isolation here: it would flatten the stack. */
  transform: rotateX(24deg); transform-origin: 50% 100%; transform-style: preserve-3d;
}
/* the ream the loose sheets lie on: a squared stack whose edges show along the front and the side,
   one hairline per sheet, with its own contact shadow on the desk */
.desk-pile::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  transform: translate3d(0.15rem, 2.2rem, 0) rotate(0.35deg);
  background: var(--paper); border-radius: 3px;
  box-shadow:
    1px 1px 0 var(--mist-2), 1px 2px 0 var(--paper), 2px 3px 0 var(--mist-2), 2px 4px 0 var(--paper),
    3px 5px 0 var(--mist-2), 3px 6px 0 var(--paper), 4px 7px 0 var(--mist-2), 4px 8px 0 var(--paper),
    5px 9px 0 var(--mist-2), 5px 10px 0 var(--paper), 6px 11px 0 var(--mist-2), 6px 12px 0 var(--paper),
    7px 13px 0 rgba(10, 13, 18, 0.16),
    4px 16px 18px -6px rgba(10, 13, 18, 0.2), 10px 34px 44px -18px rgba(10, 13, 18, 0.24);
}
.desk-sheet {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  padding: 2rem 2rem 1.4rem; /* fallback where container units are unknown */
  padding: 7.6cqi 7.6cqi 5.2cqi;
  /* lit from the upper left: white where the light falls, a breath of the desk toward the far
     corner. On the mist desk this reads as light on paper, not as a grey card (it did on white). */
  background-color: var(--paper);
  background-image: linear-gradient(160deg, var(--paper) 50%, color-mix(in srgb, var(--paper) 45%, var(--mist)) 100%);
  border: 1px solid var(--line);
  border-radius: 3px; /* paper, not a card: the one place the site's 10px card corner does not apply */
  box-shadow: 0 1px 1px rgba(10, 13, 18, 0.05), 0 5px 12px -5px rgba(10, 13, 18, 0.14);
  transform: translateZ(var(--desk-z, 0px)) var(--desk-pose, none);
  transform-origin: 50% 60%;
  transition: translate 0.4s cubic-bezier(0, 0, 0.5, 1), scale 0.4s cubic-bezier(0, 0, 0.5, 1), rotate 0.55s cubic-bezier(0, 0, 0.5, 1), box-shadow 0.4s cubic-bezier(0, 0, 0.5, 1);
  overflow: hidden;
}
.desk-sheet[data-desk-level="0"] {
  --desk-pose: rotate(-0.8deg); --desk-z: 8px; z-index: 5;
  box-shadow: 0 1px 1px rgba(10, 13, 18, 0.05), 0 10px 20px -10px rgba(10, 13, 18, 0.2), 0 30px 56px -26px rgba(10, 13, 18, 0.3);
}
.desk-sheet[data-desk-level="1"] { --desk-pose: translate(1.25rem, 0.95rem) rotate(2deg); --desk-z: 6px; z-index: 4; }
.desk-sheet[data-desk-level="2"] { --desk-pose: translate(-1.05rem, 1.6rem) rotate(-3deg); --desk-z: 4px; z-index: 3; }
.desk-sheet[data-desk-level="3"] { --desk-pose: translate(1.85rem, 2.2rem) rotate(3.6deg); --desk-z: 2px; z-index: 2; }
.desk-sheet[data-desk-level="4"] { --desk-pose: translate(0.4rem, 2.5rem) rotate(-1.2deg); z-index: 1; opacity: 0; }

/* before the pile is first seen it lies squared up; desk.js fans it out as it arrives */
.desk-pile.desk-is-stacked .desk-sheet { --desk-pose: rotate(-0.8deg); }

/* the pile in the hand: horizontal drags belong to the pile, vertical ones still scroll the page.
   A held sheet follows the finger at once; only its turn eases. */
.desk-pile { touch-action: pan-y; }
.desk-sheet[data-desk-level="0"] { cursor: grab; }
.desk-pile.desk-is-handled { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.desk-pile.desk-is-handled .desk-sheet[data-desk-level="0"] { cursor: grabbing; transition: rotate 0.3s cubic-bezier(0, 0, 0.5, 1), box-shadow 0.3s cubic-bezier(0, 0, 0.5, 1); }

/* sheets beneath: only paper, no reading, a click brings one up */
.desk-sheet:not([data-desk-level="0"]) { cursor: pointer; }
.desk-sheet:not([data-desk-level="0"]) > * { pointer-events: none; }

/* DEPTH OF FIELD: the sheet on top is in focus, the print of the ones beneath is soft and quiet.
   When a sheet comes up its parts come into focus one after another, rising a little as they
   settle (title, byline, line, citation); going beneath, they soften together, quickly. */
.desk-sheet > * { transition: opacity 0.3s ease, filter 0.3s ease, translate 0.3s ease; }
.desk-sheet:not([data-desk-level="0"]) > * { opacity: 0.5; filter: blur(1.1px); translate: 0 5px; }
.desk-sheet[data-desk-level="0"] > * {
  transition: opacity 0.5s cubic-bezier(0.28, 0.11, 0.32, 1), filter 0.5s cubic-bezier(0.28, 0.11, 0.32, 1), translate 0.55s cubic-bezier(0.28, 0.11, 0.32, 1);
}
.desk-sheet[data-desk-level="0"] > :nth-child(2) { transition-delay: 70ms; }
.desk-sheet[data-desk-level="0"] > :nth-child(3) { transition-delay: 140ms; }
.desk-sheet[data-desk-level="0"] > :nth-child(4) { transition-delay: 210ms; }
/* the first arrival: the whole pile out of focus until it lands */
.desk-pile.desk-is-stacked .desk-sheet > * { opacity: 0; filter: blur(6px); translate: 0 10px; }
/* a sheet dealt from the spread travels out of focus; desk.js lets it focus as it lands */
.desk-sheet.desk-is-incoming > * { opacity: 0; filter: blur(8px); translate: 0 12px; transition: none; }

/* the pile answers the pointer: the top sheet lifts off the desk (Apple's gentle tile lift, a
   larger and softer shadow), and the light that casts the shadow follows the hand */
.desk-pile.desk-is-near .desk-sheet[data-desk-level="0"] {
  translate: 0 -6px 46px; rotate: x -17deg; scale: 1;
  box-shadow: 0 1px 1px rgba(10, 13, 18, 0.04),
    calc(var(--desk-px, 0) * -12px) calc(14px - var(--desk-py, 0) * 8px) 26px -10px rgba(10, 13, 18, 0.2),
    calc(var(--desk-px, 0) * -24px) calc(44px - var(--desk-py, 0) * 14px) 70px -26px rgba(10, 13, 18, 0.32);
}
.desk-pile.desk-is-near .desk-sheet[data-desk-level="1"] { translate: 0.3rem 0.15rem; rotate: 0.6deg; }
.desk-pile.desk-is-near .desk-sheet[data-desk-level="2"] { translate: -0.4rem 0.3rem; rotate: -0.8deg; }
.desk-pile.desk-is-near .desk-sheet[data-desk-level="3"] { translate: 0.5rem 0.4rem; rotate: 1deg; }
.desk-pile.desk-is-near .desk-sheet:not([data-desk-level="0"]):hover { translate: 0 -0.5rem; box-shadow: 0 12px 26px -10px rgba(10, 13, 18, 0.24); }

/* the page itself: title, authors, his line, and the citation at the foot like a journal page */
.desk-sheet__t { font-size: clamp(1.2rem, 5.8cqi, 1.75rem); line-height: 1.16; text-wrap: balance; }
.desk-sheet__t a {
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease-out), color 0.2s;
}
.desk-sheet__t a:focus-visible { color: var(--accent-deep); background-size: 100% 1px; }
.desk-sheet[data-desk-len="long"] .desk-sheet__t { font-size: clamp(1.1rem, 5cqi, 1.5rem); }
.desk-sheet[data-desk-len="xlong"] .desk-sheet__t { font-size: clamp(1rem, 4.3cqi, 1.3rem); }
.desk-sheet__by { margin-top: 2.6cqi; font-size: clamp(0.8rem, 2.9cqi, 0.92rem); line-height: 1.45; color: var(--muted); }
.desk-sheet__x {
  margin-top: 5cqi;
  font-family: var(--display); font-weight: 500; font-size: clamp(0.98rem, 3.6cqi, 1.12rem); line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; overflow: hidden;
}
.desk-sheet[data-desk-xlen="mid"] .desk-sheet__x { font-size: clamp(1rem, 4.2cqi, 1.36rem); line-height: 1.52; }
.desk-sheet[data-desk-xlen="short"] .desk-sheet__x { font-size: clamp(1.08rem, 5cqi, 1.6rem); line-height: 1.46; }
/* a short or middling line sits in the middle of the page, between the byline and the citation */
.desk-sheet[data-desk-xlen="mid"] .desk-sheet__x, .desk-sheet[data-desk-xlen="short"] .desk-sheet__x { margin-top: auto; padding-top: 4.5cqi; }
/* no line to show: a title page, the title set large in the upper third */
.desk-sheet[data-desk-xlen="none"] .desk-sheet__t { margin-top: auto; font-size: clamp(1.3rem, 6.8cqi, 2.05rem); line-height: 1.13; }
.desk-sheet[data-desk-xlen="none"][data-desk-len="xlong"] .desk-sheet__t { font-size: clamp(1.12rem, 5.5cqi, 1.7rem); }
.desk-sheet[data-desk-xlen="none"] .desk-sheet__by { margin-bottom: auto; margin-top: 3.4cqi; }
.desk-sheet__cite {
  margin-top: auto; padding-top: 3cqi; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem;
  font-family: var(--label); font-weight: 600; font-size: clamp(0.72rem, 2.55cqi, 0.8rem); color: var(--muted);
}
.desk-sheet__doi { font-weight: 500; }

/* a sheet in the air casts a longer, softer shadow */
.desk-sheet.desk-is-flying { box-shadow: 0 2px 4px rgba(10, 13, 18, 0.05), 0 34px 64px -18px rgba(10, 13, 18, 0.32); }

/* the blue pencil: one line under each line of the marked phrase, drawn as the sheet lands. Each
   line is a filled shape, thin where the pencil lands and lifts, fullest mid-stroke; a mask (its
   centre line stroked in paper white) draws it in, then is removed. */
.desk-ink { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.desk-ink__line { fill: var(--accent); opacity: 0.9; }
.desk-ink__reveal { fill: none; stroke: var(--paper); stroke-width: 8; stroke-linecap: round; }

/* THE BLUE PENCIL: the editor's tool the whole desk is built on, lying where it was put down, in
   front of the pile. Drawn, not an icon: a hexagonal pencil, its three painted facets in film blue,
   the sharpened wood in the paper greys, a blue lead. Token colours only. */
.desk-pencil {
  position: absolute; left: 27%; bottom: -3.1rem; z-index: 6;
  width: 17.5rem; height: auto; aspect-ratio: 300 / 12; overflow: visible;
  transform: translateZ(14px) rotate(-10deg); transform-origin: 20% 50%;
  filter: drop-shadow(1px 3px 2px rgba(10, 13, 18, 0.22)) drop-shadow(4px 10px 9px rgba(10, 13, 18, 0.14));
  pointer-events: none;
}
.desk-pencil__w1 { fill: var(--paper); }
.desk-pencil__w2 { fill: var(--mist-2); }
.desk-pencil__w3 { fill: var(--faint); fill: color-mix(in srgb, var(--mist-2) 62%, var(--faint)); }
.desk-pencil__p1 { fill: var(--accent); fill: color-mix(in srgb, var(--accent) 68%, var(--lightbox)); }
.desk-pencil__p2 { fill: var(--accent); }
.desk-pencil__p3, .desk-pencil__lead, .desk-pencil__end { fill: var(--accent-deep); }
.desk-pencil__gloss { fill: none; stroke: var(--paper); stroke-width: 0.7; opacity: 0.35; }

/* THE SPREAD: every editorial he has written, laid out along the front of the desk in the order he
   wrote them, like a deck of pages spread across a table, a small gap between years. The ones on
   the pile are tinted, the one on top is film blue. Equal sizes on purpose: this is paper, not a
   chart (the per-year blocks belong to creds). desk.js places every sheet with transforms. */
.desk-edge { position: relative; }
.desk-edge__track {
  --desk-cw: 2rem;
  position: relative; height: 5.1rem; cursor: pointer; touch-action: pan-y;
  border-radius: 4px; -webkit-tap-highlight-color: transparent;
}
.desk-edge__track:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
/* the spread lies on the desk too, in the same perspective as the pile */
.desk-edge__leaves { position: absolute; inset: 0; transform: perspective(1100px) rotateX(24deg); transform-origin: 50% 100%; }
.desk-edge__leaf {
  position: absolute; left: 0; bottom: 0.35rem;
  width: var(--desk-cw); height: calc(var(--desk-cw) * 1.32);
  /* a small printed page: two hairlines where its title sits, seen when it is lifted out */
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, var(--mist-2) 0 1.5px, transparent 1.5px 4px);
  background-size: calc(100% - 9px) 6px;
  background-position: 4px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: -3px 1px 4px -2px rgba(10, 13, 18, 0.2); /* each page shades the one beneath it */
  transform-origin: 50% 100%;
  transition: transform 0.3s cubic-bezier(0, 0, 0.5, 1), background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.3s cubic-bezier(0, 0, 0.5, 1);
}
.desk-edge__leaf.desk-is-pile { background-color: var(--accent-tint); border-color: var(--lightbox-deep); }
.desk-edge__leaf.desk-is-top { background-color: var(--accent); border-color: var(--accent-deep); }
.desk-edge__leaf.desk-is-at { z-index: 200; box-shadow: 0 8px 16px -6px rgba(10, 13, 18, 0.35); }
/* the first time the spread is seen it is dealt out from a squared deck, 2010 to 2026 */
.desk-edge.desk-is-rising .desk-edge__leaf { transition-delay: var(--desk-d, 0ms); transition-duration: 0.9s; transition-timing-function: cubic-bezier(0.28, 0.11, 0.32, 1); }
/* the slip that rises over the pointed page: its date and title, before it is laid on the pile */
.desk-edge__slip {
  position: absolute; left: 0; bottom: calc(100% - 0.4rem); z-index: 300;
  width: 17.5rem; padding: 0.6rem 0.85rem 0.7rem;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-2);
  opacity: 0; filter: blur(4px); transform: translate(var(--desk-sx, 0px), 10px);
  transition: opacity 0.24s cubic-bezier(0.28, 0.11, 0.32, 1), filter 0.3s cubic-bezier(0.28, 0.11, 0.32, 1), transform 0.32s cubic-bezier(0.28, 0.11, 0.32, 1);
  pointer-events: none;
}
.desk-edge.desk-is-scrub .desk-edge__slip { opacity: 1; filter: blur(0); transform: translate(var(--desk-sx, 0px), 0); }
.desk-edge__when { display: block; font-family: var(--label); font-weight: 600; font-size: 0.8rem; color: var(--accent); }
.desk-edge__t {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 0.15rem; font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.25; color: var(--ink);
}
.desk-edge__years { position: relative; height: 1.2rem; margin-top: 0.1rem; font-family: var(--label); font-weight: 600; font-size: 0.76rem; color: var(--muted); }
.desk-edge__years span { position: absolute; top: 0; white-space: nowrap; }
/* no Earlier and Later buttons here: the quote reader right above owns that control, and the
   spread already takes a point, a click, a drag, a tap and the arrow keys */
.desk-edge__cap { margin-top: 0.55rem; font-size: 0.9rem; line-height: 1.45; color: var(--muted); max-width: 60ch; }

/* THE INDEX: his four, each one a way onto the top of the pile */
.desk-index { list-style: none; margin: clamp(1.6rem, 3vw, 2.2rem) 0 0; padding: 0; border-top: 1px solid var(--line); }
.desk-index li { border-bottom: 1px solid var(--line); }
.desk-index a { position: relative; display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: 1.05rem 0; text-decoration: none; color: var(--ink); }
/* the blue pencil ticks, in the margin, whichever title is on top of the pile */
.desk-index__tick { position: absolute; left: -1.75rem; top: 1.2rem; width: 1rem; height: 0.9rem; pointer-events: none; }
.desk-index__tick path {
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.22s ease-in;
}
.desk-index a[aria-current="true"] .desk-index__tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s cubic-bezier(0.6, 0.05, 0.3, 1) 0.15s; }
.desk-index__yr { font-family: var(--label); font-weight: 600; color: var(--muted); transition: color 0.2s; }
.desk-index__t { font-family: var(--display); font-weight: 600; font-size: 1.18rem; line-height: 1.3; transition: color 0.2s, translate 0.35s var(--ease-spring); }
.desk-index a[aria-current="true"] .desk-index__t, .desk-index a[aria-current="true"] .desk-index__yr { color: var(--accent); }
.desk-more { margin-top: 1.6rem; }
/* a 44px touch target around the link without moving its drawn underline */
.desk-more .link { position: relative; }
.desk-more .link::after { content: ''; position: absolute; inset: -0.75rem -0.5rem; }

/* hover styling only where a real hover exists, so a tap on a phone leaves nothing stuck on */
@media (hover: hover) {
  .desk-sheet__t a:hover { color: var(--accent-deep); background-size: 100% 1px; }
  .desk-index a:hover .desk-index__t { color: var(--accent); translate: 3px 0; }
}

.desk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .desk-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "table" "side"; }
  .desk-h { max-width: 20ch; }
  .desk-top { margin-top: 2.2rem; }
  .desk-side { margin-top: clamp(2rem, 6vw, 3rem); }
}
@media (max-width: 560px) {
  .desk-top { margin-inline: -0.25rem; }
  .desk-pile { --desk-w: calc(100% - 1.4rem); aspect-ratio: 30 / 38; margin: 0 0 2.9rem 0.2rem; }
  .desk-pile::before { transform: translate(0.1rem, 1.6rem) rotate(0.3deg); }
  .desk-sheet[data-desk-level="1"] { --desk-pose: translate(0.55rem, 0.6rem) rotate(1.4deg); }
  .desk-sheet[data-desk-level="2"] { --desk-pose: translate(-0.35rem, 1rem) rotate(-1.9deg); }
  .desk-sheet[data-desk-level="3"] { --desk-pose: translate(0.8rem, 1.3rem) rotate(2.4deg); }
  .desk-edge__track { --desk-cw: 1.45rem; height: 3.9rem; }
  .desk-pencil { left: 22%; bottom: -2.5rem; width: 12.5rem; }
  .desk-edge__slip { width: min(17.5rem, 100%); }
  .desk-index__tick { left: -1.12rem; top: 1.25rem; width: 0.85rem; }
  .desk-edge__cap { font-size: 0.86rem; }
}

/* reduced motion: everything lands at once and complete, nothing drifts or blurs in */
@media (prefers-reduced-motion: reduce) {
  .desk-sheet, .desk-sheet > *, .desk-edge__leaf, .desk-edge__slip { transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .desk-edge__slip { filter: none; }
}
