/* Editor's Desk, archive: 100x pass (2026-09-28). A white console lifted off the page (search, the
   "written alone" switch, the journal as one segmented control with a gliding plate, and the sixteen
   years as a histogram whose bars carry the journal of their era). Pointing at any choice previews
   its count before you commit. Below, the count rolls, the filters in use sit as removable tokens,
   and the list is grouped by year: the year and its journal ride a sticky rail, each row gives the
   month, the title, who wrote it with me and, where there is one, its opening line. Filtering
   glides rows to their new places (FLIP) instead of swapping them. Loaded after the page's inline
   <style>; new class names only, tokens from site.css :root. */

.darch {
  --travel: cubic-bezier(0.28, 0.11, 0.32, 1);
  --settle: cubic-bezier(0.32, 0.72, 0, 1);
  --ebsj: var(--lightbox-deep);
  scroll-margin-top: calc(var(--nav-h) + 12px);
}
.darch__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; }
.darch__top h2 { margin: 0; }
.darch__note { margin: 0; font-family: var(--label); font-weight: 500; font-size: 1rem; color: var(--muted); }

/* ---------- the console ---------- */
.dcon {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.85rem 1rem; align-items: center;
  margin-top: clamp(1.4rem, 3vw, 2rem); padding: 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-2);
}
.dcon__search { grid-column: 1; max-width: none; }
.dcon__search input {
  height: 48px; padding-right: 3rem; border-radius: 12px; background: var(--mist); border-color: transparent;
  transition: background 0.3s var(--travel), border-color 0.2s, box-shadow 0.3s var(--travel);
}
.dcon__search input:hover { border-color: var(--line-2); }
.dcon__search input:focus { background: var(--paper); }
.dcon__search input::-webkit-search-cancel-button { display: none; }
.dcon__clear {
  position: absolute; right: 0.6rem; top: 50%; translate: 0 -50%; width: 30px; height: 30px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: var(--mist-2); color: var(--ink); cursor: pointer;
  animation: darch-pop 0.35s var(--settle);
  transition: background 0.2s, transform 0.35s var(--settle);
}
.dcon__clear:hover { background: var(--line-2); }
.dcon__clear:active { transform: scale(0.9); }
.dcon__clear[hidden] { display: none; }
@keyframes darch-pop { from { opacity: 0; scale: 0.6; } }

/* "Written alone": a real switch, its knob settles and stretches while pressed */
.dsw {
  grid-column: 2; display: inline-flex; align-items: center; gap: 0.65rem; height: 48px; padding: 0 1rem 0 0.8rem;
  border: 0; border-radius: 12px; background: var(--mist); cursor: pointer;
  font-family: var(--label); font-weight: 600; font-size: 0.98rem; color: var(--ink-2);
  transition: background 0.3s var(--travel), color 0.3s;
}
.dsw:hover { background: var(--mist-2); }
.dsw__track {
  position: relative; flex: none; width: 42px; height: 26px; border-radius: 13px; background: var(--line-2);
  transition: background 0.35s var(--travel);
}
.dsw__knob {
  position: absolute; left: 2px; top: 2px; width: 22px; height: 22px; border-radius: 11px; background: var(--paper);
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.18), 0 3px 8px rgba(10, 13, 18, 0.12);
  transition: transform 0.45s var(--settle), width 0.25s var(--settle);
}
.dsw:active .dsw__knob { width: 27px; }
.dsw[aria-checked="true"] .dsw__track { background: var(--accent); }
.dsw[aria-checked="true"] .dsw__knob { transform: translateX(16px); }
.dsw[aria-checked="true"]:active .dsw__knob { transform: translateX(11px); }
.dsw[aria-checked="true"] { color: var(--ink); }
.dsw__n { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); transition: color 0.3s; }

/* Journal: one white plate glides to the chosen option (placed by JS in x and y, so it also works
   when the options wrap). The small square is the colour of that journal's bars below. */
.dseg {
  grid-column: 1 / -1; position: relative; isolation: isolate; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px;
  background: var(--mist); border-radius: 12px;
}
.dseg__plate {
  position: absolute; left: 0; top: 0; z-index: -1; border-radius: 9px; background: var(--paper);
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.08), 0 4px 14px rgba(10, 13, 18, 0.07);
  transition: transform 0.5s var(--settle), width 0.5s var(--settle), height 0.5s var(--settle);
}
.dseg.is-still .dseg__plate { transition: none; }
.dseg__opt {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 40px; padding: 0 1rem; border: 0; border-radius: 9px; background: none; white-space: nowrap;
  font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--muted); cursor: pointer;
  transition: color 0.3s var(--travel), background 0.3s, transform 0.35s var(--settle);
}
.dseg__opt:hover:not([aria-pressed="true"]) { color: var(--ink); background: rgba(255, 255, 255, 0.55); }
.dseg__opt[aria-pressed="true"] { color: var(--ink); }
.dseg__opt:active { transform: scale(0.97); }
.dseg__sw { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.dseg__sw--ebsj { background: var(--ebsj); }
.dseg__opt .n { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); transition: color 0.3s; }

/* ---------- the years ---------- */
.dyr { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.95rem 1.1rem 0.8rem; background: var(--mist); border-radius: 12px; }
.dyr__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.3rem 1rem; flex-wrap: wrap; }
.dyr__read { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; color: var(--ink); font-variant-numeric: lining-nums; transition: color 0.3s; }
.dyr__read.is-peek { color: var(--accent); }
.dyr__hint { font-family: var(--label); font-weight: 500; font-size: 0.86rem; color: var(--muted); }

/* a faint ghost bar is that year in the whole archive, the solid bar is what the other filters leave,
   and its number rides on top. Bars before 2015 are the pale blue of the Evidence-Based years. */
.dyr__cols {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 17), minmax(0, 1fr)); gap: 4px;
  height: 150px; -webkit-tap-highlight-color: transparent;
}
.dyr__band {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0px); transform: translateX(var(--x, 0px));
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow-1); opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--settle), width 0.5s var(--settle), opacity 0.3s;
}
.dyr__band.is-on { opacity: 1; }
.dyr__band.is-still { transition: opacity 0.3s; }
.dyr__col {
  position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px;
  padding: 8px 0 8px; border: 0; border-radius: 10px; background: none; font: inherit; cursor: pointer;
}
.dyr__stack { position: relative; flex: 1 1 auto; margin-inline: 18%; }
.dyr__ghost, .dyr__bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 2px 2px; }
.dyr__ghost { height: calc(var(--g, 0) * 1%); background: var(--mist-2); transition: height 0.7s var(--settle); }
.dyr__bar {
  height: max(var(--m, 0px), calc(var(--h, 0) * 1%)); background: var(--accent);
  transition: height 0.6s var(--settle), background-color 0.3s, opacity 0.3s;
}
.dyr__col.is-ebsj .dyr__bar { background: var(--ebsj); }
.dyr__n {
  position: absolute; left: 50%; bottom: calc(var(--h, 0) * 1% + 5px); translate: -50% 0;
  font-family: var(--label); font-weight: 600; font-size: 0.8rem; line-height: 1; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: bottom 0.6s var(--settle), color 0.3s, opacity 0.3s;
}
.dyr__n.is-zero { opacity: 0; }
.dyr__yr { font-family: var(--label); font-weight: 600; font-size: 0.8rem; line-height: 1; color: var(--muted); text-align: center; transition: color 0.3s; }
.dyr__short { display: none; }
.dyr__col:hover .dyr__bar, .dyr__col.is-hot .dyr__bar { background: var(--accent-deep); opacity: 1; }
.dyr__col:hover .dyr__yr, .dyr__col:hover .dyr__n, .dyr__col.is-hot .dyr__yr, .dyr__col.is-hot .dyr__n { color: var(--ink); }
.dyr__cols.has-pick .dyr__col:not([aria-pressed="true"]) .dyr__bar { opacity: 0.28; }
.dyr__col[aria-pressed="true"] .dyr__yr, .dyr__col[aria-pressed="true"] .dyr__n { color: var(--ink); }
.dyr__cols.is-peek .dyr__n { color: var(--accent); }
.dyr__col:focus-visible { outline-offset: -2px; }
/* first sight: the bars grow from the floor, left to right */
.dyr__cols:not(.is-in) .dyr__bar, .dyr__cols:not(.is-in) .dyr__ghost { height: 0; }
.dyr__cols:not(.is-in) .dyr__n { opacity: 0; bottom: 5px; }
.dyr__cols.is-intro .dyr__bar, .dyr__cols.is-intro .dyr__ghost, .dyr__cols.is-intro .dyr__n { transition-delay: calc(var(--i, 0) * 28ms); }

/* ---------- the readout: the count is the focal point ---------- */
.dread { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1.1rem; margin: 1.7rem 0 0.2rem; min-height: 2.6rem; }
.dread__count { margin: 0; font-family: var(--label); font-weight: 600; font-size: 1.05rem; color: var(--muted); }
.dread__n {
  display: inline-block; min-width: 1.2ch; margin-right: 0.25rem; font-family: var(--display); font-weight: 600; font-size: 2.2rem; line-height: 1;
  color: var(--ink); font-variant-numeric: lining-nums tabular-nums; vertical-align: -0.12em; transition: color 0.3s;
}
.dread__count.is-peek .dread__n { color: var(--accent); }
.dread__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dread__tokens { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dread__tokens:empty { display: none; }
.dtoken {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 32px; padding: 0 0.6rem 0 0.75rem;
  border: 0; border-radius: 6px; background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--label); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.35s var(--settle);
}
.dtoken svg { transition: transform 0.35s var(--settle); }
.dtoken:hover { background: var(--lightbox); color: var(--ink); }
.dtoken:hover svg { transform: rotate(90deg); }
.dtoken:active { transform: scale(0.95); }
.dtoken.is-new { animation: darch-rise 0.45s var(--travel) backwards; }
@keyframes darch-rise { from { opacity: 0; translate: 0 6px; filter: blur(4px); } }
.dread__reset {
  margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--label); font-weight: 600; font-size: 0.95rem; color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.35s var(--travel), color 0.2s; animation: darch-rise 0.45s var(--travel);
}
.dread__reset:hover { color: var(--accent-deep); background-size: 100% 1px; }
.dread__reset[hidden] { display: none; }

/* ---------- the list ---------- */
.dlist { position: relative; }
.dlist.is-sizing { overflow: clip; transition: height 0.5s var(--travel); }
.dlist__ghosts { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.dlist__ghosts > * { position: absolute; margin: 0; animation: darch-out 0.32s var(--travel) forwards; }
@keyframes darch-out { to { opacity: 0; scale: 0.985; filter: blur(3px); } }
.dlist__plate {
  position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; border-radius: 18px; background: var(--paper);
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.05), 0 12px 36px rgba(10, 13, 18, 0.10), 0 0 0 1px var(--line);
  opacity: 0; scale: 0.98; pointer-events: none;
  transition: transform 0.5s var(--settle), width 0.5s var(--settle), height 0.5s var(--settle), opacity 0.28s var(--travel), scale 0.45s var(--settle);
}
.dlist__plate.is-on { opacity: 1; scale: 1; }
.dlist__plate.is-still { transition: opacity 0.28s var(--travel), scale 0.45s var(--settle); }

.dgrp {
  position: relative; display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0 1.5rem;
  margin-top: 2.2rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.dlist__ghosts + .dgrp { margin-top: 1.2rem; }
.dgrp__head { position: sticky; top: calc(var(--nav-h) + 1.6rem); z-index: 2; align-self: start; display: flex; flex-direction: column; gap: 0.45rem; }
.dgrp__yr { font-family: var(--display); font-weight: 600; font-size: 2.7rem; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums; color: var(--ink); }
.dgrp__j { font-family: var(--label); font-weight: 600; font-size: 0.95rem; line-height: 1.25; color: var(--ink-2); }
.dgrp__n { font-family: var(--label); font-weight: 500; font-size: 0.92rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dgrp__rows { list-style: none; margin: -0.5rem 0 0; padding: 0; }

.ded { position: relative; z-index: 1; }
.ded + .ded::before {
  content: ''; position: absolute; left: 1rem; right: 1rem; top: 0; height: 1px; background: var(--line);
  transition: opacity 0.3s var(--travel);
}
.dgrp__rows.has-hot .ded.is-hot::before, .dgrp__rows.has-hot .ded.is-hot + .ded::before { opacity: 0; }
.ded__a {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr) 1.6rem; gap: 0 1rem; align-items: baseline;
  margin-inline: -1rem; padding: 1rem 1rem 1.05rem; border-radius: 18px;
  color: var(--ink); text-decoration: none; outline: none; -webkit-tap-highlight-color: transparent;
}
.ded__a:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ded__m { font-family: var(--label); font-weight: 600; font-size: 0.92rem; color: var(--muted); transition: color 0.3s; }
.ded__body { min-width: 0; display: block; }
.ded__t {
  display: block; font-family: var(--display); font-weight: 600; font-size: 1.16rem; line-height: 1.3; text-wrap: pretty;
  transition: color 0.3s var(--travel);
}
.ded.is-plain .ded__t { font-weight: 500; color: var(--ink-2); }
.ded__by { display: block; margin-top: 0.3rem; font-family: var(--label); font-weight: 500; font-size: 0.92rem; line-height: 1.3; color: var(--muted); }
.ded.is-solo .ded__by { color: var(--accent); font-weight: 600; }
.ded__ex {
  display: block; margin-top: 0.6rem; max-width: 68ch; font-family: var(--sans); font-size: 0.97rem; line-height: 1.55; color: var(--ink-2);
  text-wrap: pretty;
}
.ded__go { align-self: start; justify-self: end; margin-top: -0.1rem; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--faint); transition: color 0.3s, background 0.3s, transform 0.45s var(--settle); }
.ded__a:hover .ded__t, .ded__a:focus-visible .ded__t { color: var(--accent-deep); }
.ded__a:hover .ded__m, .ded__a:focus-visible .ded__m { color: var(--ink); }
.ded__a:hover .ded__go, .ded__a:focus-visible .ded__go { color: var(--paper); background: var(--accent); transform: translateX(3px); }
.ded__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dhl { padding: 0 1px; margin: 0 -1px; border-radius: 3px; background: var(--lightbox); color: inherit; }

/* entering rows and heads rise, blur to sharp, staggered */
.darch .is-enter { animation: darch-rise 0.5s var(--travel) backwards; animation-delay: calc(var(--d, 0) * 1ms); }

.dempty { margin: 1.4rem 0 0; padding: 2.4rem 0; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 500; font-size: 1.3rem; color: var(--ink-2); }
.dempty button { margin-left: 0.6rem; padding: 0; border: 0; background: none; cursor: pointer; font-family: var(--label); font-weight: 600; font-size: 1rem; color: var(--accent); }
.dempty button:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }

.dmore { display: flex; margin: 2rem auto 0; }
.dmore[hidden] { display: none; }

/* ---------- widths ---------- */
@media (max-width: 960px) {
  .dgrp { grid-template-columns: minmax(0, 1fr); }
  .dgrp__head { position: static; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; margin-bottom: 0.9rem; }
  .dgrp__yr { font-size: clamp(1.7rem, 4.6vw, 2.1rem); }
  .dgrp__rows { margin-top: 0; }
}
@media (max-width: 600px) {
  .dcon { grid-template-columns: minmax(0, 1fr); padding: 0.65rem; gap: 0.55rem; }
  .dcon__search, .dsw, .dseg, .dyr { grid-column: 1; }
  .dcon__search input { height: 46px; }
  .dsw { height: 44px; justify-self: start; }
  .dseg__opt { height: 38px; padding: 0 0.7rem; font-size: 0.9rem; }
  .dyr { padding: 0.8rem 0.7rem 0.7rem; }
  .dyr__cols { height: 128px; gap: 2px; }
  .dyr__stack { margin-inline: 12%; }
  .dyr__full { display: none; }
  .dyr__short { display: inline; }
  .dyr__yr { font-size: 0.64rem; }
  .dyr__n { font-size: 0.68rem; }
  .dyr__read { font-size: 1.15rem; }
  .dread { margin-top: 1.3rem; gap: 0.5rem 0.8rem; }
  .dread__n { font-size: 1.9rem; }
  .dgrp { margin-top: 1.6rem; padding-top: 1.1rem; }
  .ded__a { grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0 0.7rem; margin-inline: -0.6rem; padding: 0.85rem 0.6rem 0.9rem; }
  .ded + .ded::before { left: 0.6rem; right: 0.6rem; }
  .ded__go { display: none; }
  .ded__m { font-size: 0.85rem; }
  .ded__t { font-size: 1.05rem; }
  .ded__by { font-size: 0.86rem; }
  .ded__ex { font-size: 0.92rem; }
  .darch__note { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .darch *, .darch *::before { transition: none !important; animation: none !important; }
}

/* page pass: the hero already piles every editorial by year, so here the year chart is a slim
   instrument for picking a year, not a second picture of the same thing */
.dyr__cols { height: 72px; }
@media (max-width: 600px) { .dyr__cols { height: 64px; } }

/* page pass: from an editorial back up to the sentence the reader above quotes from it */
.ded__quoted {
  position: relative; z-index: 1; display: inline-flex; gap: 0.3rem; margin: -0.55rem 0 0.9rem calc(3rem + 1rem);
  font-family: var(--label); font-weight: 600; font-size: 0.86rem; color: var(--accent-deep); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.4s cubic-bezier(0.28, 0.11, 0.32, 1);
}
.ded__quoted:hover, .ded__quoted:focus-visible { background-size: 100% 1.5px; }
