/* Barbell. Left plate: discovery, as mad as possible (every aphorism, a collage dealt at build time).
   Right plate: verification, as sober as possible (a ledger of claim, check, result).
   The bar between carries the only middle-ground text, and the relations: lines drawn along it
   from an aphorism to the works that share its idea, and back. */
:root {
  --page: #b9bbb6; --steel: #17181a; --steel-2: #4a4c50;
  --mad-bg: #2a2ee0; --m1: #ff58d6; --m2: #ffe93b; --m3: #ffffff; --m4: #0b0b26; --m5: #ff6b1f; --m6: #5cf2c4;
  --ghost: rgba(255,255,255,.22); --lift-bg: #ffffff; --lift-ink: #0b0b26;
  --sob-bg: #ffffff; --sob-ink: #111111; --sob-2: #707070; --sob-hair: #d6d6d6; --sob-hl: #f0f0f0;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --barw: clamp(190px, 17vw, 260px);
  --gl: max(16px, env(safe-area-inset-left, 0px)); --gr: max(16px, env(safe-area-inset-right, 0px));
  --vh: calc(100dvh - var(--bar-h));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #2a2b2d; --steel: #d8d9d5; --steel-2: #9c9ea2;
    --mad-bg: #1a1c9c; --m1: #ff6fdc; --m2: #f7e23e; --m3: #f2f2ff; --m4: #05051a; --m5: #ff7a33; --m6: #4fe0b4;
    --ghost: rgba(255,255,255,.16); --lift-bg: #f2f2f2; --lift-ink: #05051a;
    --sob-bg: #0c0c0c; --sob-ink: #e6e6e6; --sob-2: #8a8a8a; --sob-hair: #2e2e2e; --sob-hl: #1d1d1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #2a2b2d; --steel: #d8d9d5; --steel-2: #9c9ea2;
  --mad-bg: #1a1c9c; --m1: #ff6fdc; --m2: #f7e23e; --m3: #f2f2ff; --m4: #05051a; --m5: #ff7a33; --m6: #4fe0b4;
  --ghost: rgba(255,255,255,.16); --lift-bg: #f2f2f2; --lift-ink: #05051a;
  --sob-bg: #0c0c0c; --sob-ink: #e6e6e6; --sob-2: #8a8a8a; --sob-hair: #2e2e2e; --sob-hl: #1d1d1d;
  color-scheme: dark;
}
body { background: var(--page); color: var(--steel); font-family: var(--sans); }
:where(.bb) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }

.bb { display: grid; grid-template-columns: minmax(0,1fr) var(--barw) minmax(0,1fr); min-height: var(--vh); overflow-x: clip; }

/* Left plate */
.mad { position: sticky; top: var(--bar-h); height: var(--vh); align-self: start; background: var(--mad-bg); overflow: hidden; isolation: isolate; }
.collage { position: absolute; inset: 0; overflow: hidden; container-type: size;
  --ff0: "Bricolage Grotesque", sans-serif; --ff1: Fraunces, serif; --ff2: "Big Shoulders Display", sans-serif;
  --ff3: Syne, sans-serif; --ff4: "Instrument Serif", serif; --ff5: "Permanent Marker", cursive; }
/* Placement: the build writes both shapes on each item; the phone shape falls back to the tall one. */
.pl { left: var(--l); top: var(--t); width: var(--w, auto); font-size: var(--f); transform: rotate(var(--r, 0deg)); }
.it { position: absolute; display: block; line-height: .98; letter-spacing: -.01em; transform-origin: 50% 50%;
  overflow-wrap: break-word; hyphens: none; text-decoration: none; }
a.it { cursor: pointer; }
.it.up { overflow-wrap: normal; word-break: normal; }
.it.anim { transition: left .7s cubic-bezier(.3,1.4,.5,1), top .7s cubic-bezier(.3,1.4,.5,1), transform .7s cubic-bezier(.3,1.4,.5,1), font-size .7s, width .7s; }
.it.es::before { content: "forthcoming"; display: block; font: 700 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.ghost { position: absolute; font-family: "Big Shoulders Display", var(--sans); font-weight: 900; line-height: .8; text-transform: uppercase; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px var(--ghost); pointer-events: none; transform-origin: 0 0; }
.ghost.lit { -webkit-text-stroke-color: var(--m2); color: color-mix(in srgb, var(--m2) 18%, transparent); }
.collage.rel .it:not(.lit) { opacity: .16; }
.it[aria-pressed="true"] { text-decoration: underline 3px; text-underline-offset: .12em; }
.it.up { z-index: 999 !important; background: var(--lift-bg); color: var(--lift-ink) !important; box-shadow: 0 0 0 8px var(--lift-bg), 10px 12px 0 8px var(--m4);
  writing-mode: horizontal-tb !important; text-orientation: mixed !important; letter-spacing: 0 !important; text-transform: none !important; max-width: calc(100cqw - 40px); opacity: 1 !important; text-decoration: none; }
.it.up::after { content: attr(data-date); display: block; font: 400 10px/1.6 var(--mono); margin-top: 4px; }
.it:focus-visible { outline: 3px dashed var(--m2); outline-offset: 6px; }
.collage.plain { overflow-y: auto; padding: 20px var(--gl) 80px; display: flex; flex-direction: column; gap: 14px; }
.collage.plain .it { position: static; transform: none !important; width: auto !important; font-size: 17px !important; writing-mode: horizontal-tb !important; line-height: 1.25; letter-spacing: 0; text-transform: none !important; }
.collage.plain .ghost { display: none; }
.ctl { position: absolute; left: var(--gl); bottom: 16px; z-index: 1000; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font: 700 12px/1 var(--mono); color: var(--m3); text-transform: uppercase; letter-spacing: .08em; }
.ctl .lbl { background: var(--m4); padding: 6px 8px; }
.ctl button { font: 900 22px/1 "Big Shoulders Display", var(--sans); background: var(--m2); color: var(--m4); padding: 6px 12px 7px; text-transform: uppercase; letter-spacing: .02em; }
.ctl #shake { transform: rotate(-4deg); }
.ctl #plain { background: var(--m3); transform: rotate(2deg); }
.ctl #plain[aria-pressed="true"] { background: var(--m1); }
.ctl button:focus-visible { outline: 3px solid var(--m3); outline-offset: 3px; }
.ctl #seed { font-weight: 400; opacity: .8; }

/* The bar */
.bbar { position: sticky; top: var(--bar-h); height: var(--vh); align-self: start; display: grid; grid-template-rows: 1fr auto 1fr; padding-inline: 14px; font-size: 11.5px; line-height: 1.45; }
.bbar .top { align-self: end; padding-bottom: 12px; }
.bbar .bot { align-self: start; padding-top: 12px; }
.bbar h1 { font: 700 clamp(26px, 2.1vw, 32px)/1.02 var(--sans); margin: 0 0 10px; letter-spacing: -.015em; }
.bbar p { margin: 0 0 8px; color: var(--steel-2); max-width: 34ch; }
.bbar a { color: var(--steel); }
.bbar a:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
.rod { position: relative; height: 3px; background: var(--steel); margin-inline: -14px; }
.collar { position: absolute; top: -13px; width: 9px; height: 29px; background: var(--steel); }
.collar.l { left: 0; } .collar.r { right: 0; }
.bbar .readout { min-height: 2.9em; font: 400 10.5px/1.45 var(--mono); color: var(--steel); }
.readout a { white-space: nowrap; }
.plinks a { margin-right: 10px; }

/* Right plate */
.sober { background: var(--sob-bg); color: var(--sob-ink); font: 400 12px/1.55 var(--mono); font-variant-numeric: tabular-nums lining-nums;
  padding: 28px var(--gr) 48px 24px; min-width: 0; }
.sober h2, .sober h3 { font: 700 12px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .12em; margin: 0; }
.sober .head { display: flex; justify-content: space-between; gap: 2ch; border-bottom: 3px solid var(--sob-ink); padding-bottom: 6px; }
.sober .head span { color: var(--sob-2); }
.sober h3 { margin-top: 40px; border-bottom: 1px solid var(--sob-ink); padding-bottom: 4px; }
.g { display: grid; grid-template-columns: 3ch 7ch minmax(0,1fr) 5ch; column-gap: 1.5ch; }
.lrow { border-top: 1px solid var(--sob-hair); padding-block: 12px 14px; }
.lrow:first-of-type { border-top: 0; }
.lrow .no, .iurow .no { grid-column: 1; color: var(--sob-2); }
.tt { grid-column: 2 / 4; }
.lrow .tt { font-weight: 700; }
.pin { text-decoration: none; }
.pin:hover, .pin[aria-pressed="true"] { text-decoration: underline 2px; text-underline-offset: 3px; }
.sober .open { font-weight: 400; font-size: 10.5px; color: var(--sob-2); white-space: nowrap; margin-left: .5ch; }
.sober .open:hover { color: var(--sob-ink); }
.yr { grid-column: 4; text-align: right; }
.lrow .k { grid-column: 2; color: var(--sob-2); }
.lrow .v { grid-column: 3 / 5; }
.lrow .meta { color: var(--sob-2); }
.lrow .res { font-weight: 700; }
.sober a { color: var(--sob-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
.sober .v a + a, .sober .m a + a { margin-left: 2ch; }
.sober button:focus-visible, .sober a:focus-visible { outline: 2px solid var(--sob-ink); outline-offset: 2px; }
.colh { color: var(--sob-2); padding-block: 6px; border-bottom: 1px solid var(--sob-ink); }
.colh span:nth-child(2) { grid-column: 2 / 4; }
.iurow { border-top: 1px solid var(--sob-hair); padding-block: 7px; color: var(--sob-ink); }
.iurow .m { grid-column: 2 / 5; color: var(--sob-2); }
.iurow .m a { margin-left: 1ch; }
.rrow { display: grid; grid-template-columns: 11ch minmax(0,1fr); column-gap: 1.5ch; border-top: 1px solid var(--sob-hair); padding-block: 5px; }
.rrow .m { color: var(--sob-2); }
.sober.rel .lrow:not(.lit), .sober.rel .iurow:not(.lit) { opacity: .32; }
.lrow.lit, .iurow.lit { background: var(--sob-hl); box-shadow: inset 2px 0 0 var(--sob-ink), -8px 0 0 var(--sob-hl); }
.lrow.on, .iurow.on { box-shadow: inset 4px 0 0 var(--sob-ink), -8px 0 0 var(--sob-hl); }
.lrow.on .no, .iurow.on .no { color: var(--sob-ink); font-weight: 700; }
.fn { margin-top: 28px; color: var(--sob-2); }
.lrow, .iurow { scroll-margin-block: calc(var(--bar-h) + 24px) 24px; }

/* Above the plates, below the site bar. */
#wires { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 45; overflow: visible; }

/* Phone: plates stack; the bar stands up between them. */
@media (max-width: 760px) {
  .bb { grid-template-columns: minmax(0,1fr); align-content: start; }
  .mad { position: relative; top: auto; height: auto; }
  .collage { position: relative; inset: auto; height: max(720px, 190vw); }
  .pl { left: var(--pl, var(--l)); top: var(--pt, var(--t)); width: var(--pw, var(--w, auto)); font-size: var(--pf, var(--f)); transform: rotate(var(--pr, var(--r, 0deg))); }
  .bbar { position: relative; top: auto; height: auto; display: grid; grid-template-columns: 3px minmax(0,1fr); grid-template-rows: none; column-gap: 18px;
    padding: 0 var(--gr) 0 calc(var(--gl) + 20px); }
  .rod { grid-column: 1; grid-row: 1 / 3; width: 3px; height: auto; margin: 0; }
  .collar { left: -13px !important; width: 29px; height: 9px; }
  .collar.l { top: 0; } .collar.r { top: auto; bottom: 0; }
  .bbar .top, .bbar .bot { grid-column: 2; padding: 0; }
  .bbar .top { grid-row: 1; padding-top: 28px; } .bbar .bot { grid-row: 2; padding-bottom: 28px; }
  .bbar h1 { font-size: 32px; }
  .bbar p { max-width: 60ch; }
  .sober { padding: 24px var(--gr) 40px var(--gl); font-size: 11.5px; }
  .g { grid-template-columns: 2ch 6ch minmax(0,1fr) 4ch; column-gap: 1ch; }
}
@media (prefers-reduced-motion: reduce) { .it, .it.anim { transition: none !important; } }
