@font-face { font-family: "Emotion Display"; src: url("fonts/emotion-display.woff") format("woff"); font-style: italic; font-weight: 600; font-display: swap; }
:root {
  --surface: #fcfcfb;
  --surface-2: #f3f2ef;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #8a8984;
  --rule: #e4e3df;
  --accent: #2a78d6;
  --muted: #b9b8b1;
  --div-pos: #2a78d6;
  --div-neg: #e34948;
  --div-mid: #f0efec;
  --joy: #eda100;
  --love: #e87ba4;
  --surprise: #1baf7a;
  --sadness: #2a78d6;
  --anger: #e34948;
  --fear: #6250d6;
  --measure: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1a1a19;
    --surface-2: #242422;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --ink-3: #8f8e86;
    --rule: #383835;
    --accent: #3987e5;
    --muted: #5b5a55;
    --div-pos: #3987e5;
    --div-neg: #e66767;
    --div-mid: #383835;
    --joy: #c98500;
    --love: #d55181;
    --surprise: #199e70;
    --sadness: #3987e5;
    --anger: #e66767;
    --fear: #9085e9;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 17px/1.65 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: var(--measure); margin: 0 auto; padding: 3rem 1.25rem 5rem; }
h1, h2, h3, .sans, figcaption, table, .chart, button, .tag, nav, .note {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}
h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -.01em; }
h1 em { font-style: italic; }
.subtitle { font-size: 1.25rem; color: var(--ink-2); margin: 0 0 1rem; font-style: italic; }
.byline { font-size: .9rem; color: var(--ink-3); margin-bottom: 2rem; }
h2 { font-size: 1.5rem; margin: 3.2rem 0 .8rem; line-height: 1.25; }
h3 { font-size: 1.15rem; margin: 2.2rem 0 .5rem; }
p { margin: 0 0 1.1rem; }
a { color: var(--accent); text-underline-offset: 2px; }
code { font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: .1em .3em; border-radius: 3px; }
blockquote { margin: 1.5rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px solid var(--rule); color: var(--ink-2); font-size: 1.2rem; font-style: italic; }
blockquote cite { display: block; font-size: .9rem; font-style: normal; margin-top: .3rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
li { margin-bottom: .35rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

figure { margin: 1.8rem 0; }
figure.wide { margin-left: calc(-1 * clamp(0px, (100vw - var(--measure)) / 2, 8rem)); margin-right: calc(-1 * clamp(0px, (100vw - var(--measure)) / 2, 8rem)); }
figcaption { font-size: .82rem; color: var(--ink-3); margin-top: .5rem; line-height: 1.45; }
.hero video, .hero img { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--rule); }

.tldr { background: var(--surface-2); border-radius: 8px; padding: 1rem 1.3rem .3rem; margin: 1.5rem 0 2rem; }
.tldr h2 { margin: 0 0 .5rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.note { font-size: .85rem; color: var(--ink-2); background: var(--surface-2); border-left: 3px solid var(--muted); padding: .6rem .9rem; border-radius: 0 6px 6px 0; margin: 1.2rem 0; }
.latex { font: 1.05rem ui-monospace, Menlo, monospace; text-align: center; margin: 1.2rem 0; color: var(--ink); }

table { border-collapse: collapse; width: 100%; font-size: .85rem; margin: 1.2rem 0; }
th, td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.tag { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.tag::before { content: ""; width: .65em; height: .65em; border-radius: 2px; background: var(--c, var(--muted)); }

/* galleries */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.gallery .cell { cursor: pointer; position: relative; font: .72rem/1.3 -apple-system, sans-serif; color: var(--ink-2); }
.gallery .cell img { width: 100%; display: block; border-radius: 5px; border: 2px solid transparent; transition: filter .2s; }
.gallery .cell.sel img { border-color: var(--accent); }
.gallery .lab { margin-top: .2rem; display: flex; justify-content: space-between; gap: .3rem; }
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; font: .8rem -apple-system, sans-serif; color: var(--ink-3); }
.detail { display: grid; grid-template-columns: 200px 1fr; gap: 1.2rem; margin-top: 1rem; padding: 1rem; background: var(--surface-2); border-radius: 8px; }
.detail img { width: 100%; border-radius: 5px; }
.detail .quote { font-style: italic; font-size: .95rem; margin: .4rem 0; }
.detail .quote b, .tooltip b { font-style: normal; font-weight: 650; }
.detail .meta { font: .8rem -apple-system, sans-serif; color: var(--ink-2); }
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; }
  h1 { font-size: 1.8rem; }
}

/* step scrubber */
.scrubber { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.scrubber .big { width: 100%; border-radius: 6px; border: 1px solid var(--rule); }
.strip { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
.strip figure { margin: 0; flex: 0 0 128px; scroll-snap-align: start; cursor: pointer; }
.strip img { width: 128px; border-radius: 4px; border: 2px solid transparent; display: block; }
.strip figure.sel img { border-color: var(--accent); }
.strip figcaption { text-align: center; margin-top: .2rem; }
input[type=range] { width: 100%; accent-color: var(--accent); }
@media (max-width: 640px) { .scrubber { grid-template-columns: 1fr; } }

/* charts */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-2); font-size: 12px; }
.chart .title { fill: var(--ink); font-size: 15px; font-weight: 600; }
.chart .strong { fill: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font: .78rem -apple-system, sans-serif; margin: .4rem 0; }
.legend button { border: 1px solid var(--rule); background: none; color: var(--ink-2); border-radius: 4px; padding: .15rem .5rem; cursor: pointer; font-size: .78rem; }
.legend button.off { opacity: .35; }
.tooltip { position: fixed; pointer-events: none; background: var(--ink); color: var(--surface); font: .78rem/1.35 -apple-system, sans-serif; padding: .4rem .55rem; border-radius: 5px; max-width: 280px; z-index: 10; opacity: 0; transition: opacity .1s; }

/* 3D */
.space3d { position: relative; }
.space3d canvas { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 8px; cursor: grab; touch-action: none; }
.space3d canvas:active { cursor: grabbing; }

/* magnifier */
.zoomwrap { position: relative; display: inline-block; width: 100%; }
.zoomwrap img { width: 100%; display: block; border-radius: 6px; cursor: crosshair; }
.lens { position: absolute; width: 170px; height: 170px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.35); pointer-events: none; background-repeat: no-repeat; display: none; }
.zoomgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.zoomgrid figure { margin: 0; }
@media (max-width: 640px) { .zoomgrid { grid-template-columns: repeat(2, 1fr); } }

.flow svg { width: 100%; height: auto; }
.flow text { font-family: -apple-system, sans-serif; }
footer { font: .8rem -apple-system, sans-serif; color: var(--ink-3); margin-top: 4rem; }
.refs li { font-size: .92rem; }

/* flow diagram (section 2.2) */
.flow .box { fill: none; stroke: var(--ink-3); stroke-width: 1.25; }
.flow .box.main { fill: var(--accent); fill-opacity: .12; stroke: var(--accent); stroke-width: 2; }
.flow .name { fill: var(--ink); font-size: 13px; font-weight: 600; text-anchor: middle; }
.flow .sub { fill: var(--ink-2); font-size: 11.5px; text-anchor: middle; }
.flow .edge { fill: none; stroke: var(--ink-3); stroke-width: 1.25; }
.flow .grad { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.flow .note-t { fill: var(--ink); font-size: 12px; }
.flow .note-q { fill: var(--ink-2); font-size: 12px; }
.flow .arrow { fill: var(--ink-3); }
.flow .arrow-g { fill: var(--accent); }

/* fixes after the first render check */
.scrubber > * { min-width: 0; }
.detail > * { min-width: 0; }
.detail .bars .chart { max-width: 380px; }
.detail .bars .chart text { font-size: 13px; }

/* top row: the two live visualizations side by side */
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.hero-row > figcaption { grid-column: 1 / -1; margin-top: 0; }
.hero-card { background: var(--surface-2); border-radius: 10px; padding: .9rem; min-width: 0; display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif; }
.hero-card h4 { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 900px) { .hero-row { grid-template-columns: minmax(0, 1fr); } }

/* hero player */
.hp-head { font-size: .82rem; color: var(--ink-2); margin-bottom: .6rem; }
.hp-head q { color: var(--ink); }
.hp-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: .8rem; align-items: start; }
.hp-img img { width: 100%; max-width: 384px; aspect-ratio: 1; display: block; border-radius: 6px; background: #808080; }
.hp-step { font-size: .75rem; color: var(--ink-3); margin-bottom: .4rem; font-variant-numeric: tabular-nums; }
.hp-row { display: grid; grid-template-columns: 3.7rem minmax(0, 1fr) 2.1rem; align-items: center; gap: .35rem; font-size: .78rem; color: var(--ink-2); margin: .38rem 0; }
.hp-row.on { color: var(--ink); font-weight: 600; }
.hp-track { height: 10px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.hp-fill { display: block; height: 100%; width: 0; border-radius: 3px; opacity: .55; }
.hp-row.on .hp-fill { opacity: 1; }
.hp-val { text-align: right; font-variant-numeric: tabular-nums; }
.hp-quote { margin-top: 1rem; min-height: 2.9em; font-size: .82rem; color: var(--ink-2); opacity: 0; transition: opacity .4s; }
.hp-quote.show { opacity: 1; }
.hp-quote q { font: italic .92rem/1.4 Charter, Georgia, serif; color: var(--ink); }

/* the emotion space at the top: drawn on the page's own surface, following its theme */
.hero-card.hero-space { padding: 0; overflow: hidden; }
.space3d { position: relative; }
.space3d canvas { width: 100%; height: auto; display: block; border-radius: 8px; cursor: grab; touch-action: none; }
.space-ui { position: absolute; top: .55rem; left: .55rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.pill { font: 500 .7rem -apple-system, sans-serif; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--rule);
  border-radius: 999px; padding: .15rem .55rem; cursor: pointer; backdrop-filter: blur(4px); }
.pill.off { color: var(--ink-3); background: transparent; border-color: color-mix(in srgb, var(--rule) 60%, transparent); }
.space-key { position: absolute; left: .85rem; bottom: .7rem; display: flex; flex-wrap: wrap; gap: .2rem .7rem; font: .68rem -apple-system, sans-serif; color: var(--ink-2); pointer-events: none; }
.space-key i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .3rem; vertical-align: 1px; }
.space-hint { position: absolute; right: .8rem; bottom: .7rem; font: .68rem -apple-system, sans-serif; color: var(--ink-3); pointer-events: none; transition: opacity .6s; }
.space-hint.gone { opacity: 0; }
@media (max-width: 640px) { .space-key { right: .8rem; } .space-hint { display: none; } }
@media (max-width: 640px) {
  .hp-body { grid-template-columns: 1fr; }
  .hp-img img { max-width: 100%; }
}

/* cosine carousel (section 2.1) */
.carousel { margin: .3rem 0 0; font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif; }
.car-stage { position: relative; }
.car-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none;
  padding: 1rem calc(50% - 160px) 1.4rem;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 17%, #000 83%, transparent 100%); }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 320px; scroll-snap-align: center; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: .7rem .8rem .55rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .07); transform-origin: center; cursor: pointer; will-change: transform, opacity, filter; }
.car-slide.on { box-shadow: 0 14px 36px rgba(0, 0, 0, .14); cursor: default; }
.car-slide svg { width: 100%; height: auto; display: block; }
.car-slide text { fill: var(--ink-2); }
.car-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .78rem; color: var(--ink-2); margin-bottom: .35rem; }
.car-head b { color: var(--ink); font-size: .95rem; }
.car-tag { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: .02rem .4rem; }
.car-tag.alt { color: var(--ink-3); }
.car-stat { margin-left: auto; font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 20; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.car-btn.prev { left: .3rem; } .car-btn.next { right: .3rem; }
.car-btn:disabled { opacity: .3; cursor: default; }
.car-nav { display: flex; gap: .4rem; max-width: 560px; margin: .1rem auto 0; }
.car-yticks { display: flex; flex-direction: column; justify-content: space-between; font-size: .62rem; color: var(--ink-3); height: 56px; text-align: right; line-height: 1; }
.car-bars { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 3px; height: 56px; border-bottom: 1px solid var(--rule); }
.car-chance { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--ink-3); pointer-events: none; }
.car-chance span { position: absolute; left: 100%; top: -.6em; margin-left: .35rem; font-size: .62rem; color: var(--ink-3); white-space: nowrap; }
.car-bar { flex: 1; height: var(--h); min-width: 0; background: var(--muted); border: 0; border-radius: 2px 2px 0 0; padding: 0; cursor: pointer; opacity: .65; position: relative; transition: opacity .15s, background .15s; }
.car-bar:hover { opacity: 1; }
.car-bar.def { background: color-mix(in srgb, var(--accent) 40%, var(--muted)); }
.car-bar.read::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); transform: translateX(-50%); }
.car-bar.on { background: var(--accent); opacity: 1; }
.car-axis { display: flex; justify-content: space-between; gap: 1rem; max-width: 560px; margin: .55rem auto 0; padding-left: 1.9rem; font-size: .7rem; color: var(--ink-3); }
@media (max-width: 640px) { .car-slide { flex-basis: 270px; } .car-track { padding-inline: calc(50% - 135px); } .car-axis span:nth-child(2) { display: none; } }

/* equations (section 2.2) */
math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "STIX Two Text", math; }
.eq { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; margin: .6rem 0 .9rem; padding: .45rem 0; overflow-x: auto; overflow-y: hidden; }  /* padding leaves room for sub/superscript ink so no vertical scrollbar appears */
.eq math { font-size: 1.18em; }
.eq .no { font: .85rem -apple-system, sans-serif; color: var(--ink-3); }

/* flow diagram, second version */
.flow .box.frozen { fill: var(--surface-2); stroke: var(--ink-3); stroke-dasharray: 5 4; }
.flow .cap { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.flow .layer { stroke: var(--rule); stroke-width: 2; }
.flow .layer.accent { stroke: var(--accent); stroke-width: 3; }
.flow .edge.accent { stroke: var(--accent); stroke-width: 2; }
.flow .sub.left { text-anchor: start; }
.flow .box { fill: var(--surface); }
.flow .box.main { fill: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

/* magnifier cue (section 3.2) */
.zoomwrap img { cursor: zoom-in; }
.zoom-badge { position: absolute; top: .5rem; right: .5rem; display: flex; align-items: center; gap: .3rem; padding: .18rem .5rem .18rem .38rem;
  font: 600 .68rem -apple-system, sans-serif; color: #fff; background: rgba(15, 17, 23, .62); border-radius: 999px; backdrop-filter: blur(4px);
  pointer-events: none; transition: opacity .3s; }
.zoom-badge svg { width: .85rem; height: .85rem; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.zoomwrap:hover .zoom-badge { opacity: 0; }
.lens { transition: opacity .2s; }

/* seed selector above the galleries */
.seedbar { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .6rem; font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif; }
.seedbar button { font-size: .74rem; padding: .18rem .6rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.seedbar button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* live loss diagram (section 2.2) */
.flow .thumb { fill: none; stroke: var(--rule); stroke-width: 1; }
.flow image.px { image-rendering: pixelated; }
.flow .name.left, .flow .sub.left { text-anchor: start; }
.flow .name.right { text-anchor: end; font-variant-numeric: tabular-nums; }
.flow .tiny { font-size: 9.5px; fill: var(--ink-3); }
.flow .tiny.mid { text-anchor: middle; }
.flow .tiny.strong { fill: var(--ink); font-weight: 600; }
.flow .tiny.accent { fill: var(--accent); font-weight: 600; }
.flow .spark { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-opacity: .8; }
.flow .spark-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.flow .zero { stroke: var(--ink-3); stroke-width: .75; }
.flow .note-t.mid { text-anchor: middle; }
.flow .step-t { font-size: 12.5px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }

/* replay button in the 3D view */
.space-ui .pill.replay { border-color: var(--ink-3); }
.space-ui .pill.replay.playing { opacity: .45; }

/* two recipes for anger (section 3.3) */
.astrip { margin: 0 0 .9rem; }
.astrip-h { font: 600 .8rem -apple-system, sans-serif; color: var(--ink-2); margin: 0 0 .35rem; }
.astrip-g { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .4rem; }
.astrip .cell { cursor: pointer; position: relative; font: .68rem/1.25 -apple-system, sans-serif; color: var(--ink-2); }
.astrip .cell img { width: 100%; display: block; border-radius: 4px; transition: filter .2s; }
.astrip .lab { margin-top: .15rem; display: flex; justify-content: space-between; gap: .2rem; }
@media (max-width: 640px) { .astrip-g { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* a word forming (section 4) */
.wordlapse { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .2rem; }
.wordlapse figure { margin: 0; flex: 1 0 120px; }
.wordlapse img { width: 100%; display: block; border-radius: 4px; }
.wordlapse figcaption { font: .72rem -apple-system, sans-serif; color: var(--ink-3); text-align: center; margin-top: .2rem; }

/* timeline control shared by the love player and the loss diagram: play button + the run's p(love) curve as the track */
.tl { display: flex; align-items: center; gap: .75rem; margin-top: auto; padding-top: .55rem; }
.tl-play { flex: none; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 4px; background: none;
  color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: color .15s, transform .15s; }
.tl-play:hover { color: var(--ink); transform: scale(1.12); }
.tl-play svg { width: 1.05rem; height: 1.05rem; fill: currentColor; display: block; pointer-events: none; }
.tl-play:focus-visible, .tl-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tl-track { flex: 1; min-width: 0; height: 32px; cursor: pointer; touch-action: none; border-radius: 4px; }
.tl-svg { display: block; overflow: visible; }
.tl-base { stroke: var(--rule); stroke-width: 1; }
.tl-line { fill: none; stroke: var(--ink-3); stroke-width: 1.2; stroke-opacity: .45; stroke-linejoin: round; }
.tl-line.on { stroke: var(--love); stroke-opacity: 1; stroke-width: 1.6; }
.tl-area { fill: var(--love); fill-opacity: .13; }
.tl-key { font: 9.5px -apple-system, sans-serif; fill: var(--ink-3); text-anchor: end; }
.tl-head { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 2; }
.tl-dot { fill: var(--love); stroke: var(--surface); stroke-width: 2; transition: r .12s; }
.tl-track:hover .tl-dot, .tl-track.drag .tl-dot { r: 5.5; }
.hero-card .tl-dot { stroke: var(--surface-2); }
.tl-lab { flex: none; min-width: 6.4rem; text-align: right; font: .74rem -apple-system, sans-serif; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-lab b { color: var(--ink-2); font-weight: 600; }
.flow-live .tl { max-width: 620px; margin: .4rem auto 0; }

/* hover card for images in the 3D view: the model's answer, not just the picture */
.tooltip.rich { max-width: min(470px, calc(100vw - 16px)); width: 470px; padding: .85rem .9rem .75rem; border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.ic { display: flex; gap: .85rem; align-items: flex-start; }
.ic-l { flex: none; width: 124px; }
.ic-l img { width: 124px; height: 124px; border-radius: 5px; display: block; object-fit: cover; }
.ic-t { margin-top: .3rem; text-align: center; font: 1.5rem/1.15 "Emotion Display", "Playfair Display", Georgia, serif; font-style: italic; letter-spacing: .01em; }
.ic-t.start { opacity: .6; }
.ic-msg { min-width: 0; }
.ic-msg p { margin: 0 0 .5rem; }
.ic-msg p:last-child { margin-bottom: 0; }
.ic-who { font: 700 .6rem/1 -apple-system, BlinkMacSystemFont, sans-serif; font-style: normal; letter-spacing: .1em; text-transform: uppercase;
  margin-right: .5rem; opacity: .5; vertical-align: .12em; }
.ic-a .ic-who { opacity: 1; }
.ic-q { font-size: .88rem; opacity: .8; }
.ic-a { font: italic .98rem/1.45 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; }
.ic-a b { font-style: normal; font-weight: 650; }
.ic-c { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; font-size: .8rem; }
.ic-lab { opacity: .6; flex: none; }
.ic-bar { flex: 1; display: flex; height: 9px; border-radius: 4px; overflow: hidden; gap: 1px; background: rgba(127,127,127,.25); }
.ic-bar i { display: block; min-width: 0; }
.ic-p { flex: none; font-variant-numeric: tabular-nums; }

/* results gallery detail: the question and the model's answer as a short dialog (same labels as the hover card) */
.detail .dlg { margin-top: .8rem; }
.detail .dlg p { margin: 0 0 .45rem; }
.detail .who { font: 700 .62rem/1 -apple-system, BlinkMacSystemFont, sans-serif; font-style: normal; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin-right: .5rem; vertical-align: .12em; }
.detail .dlg-q { font: .86rem -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink-2); }
.detail .dlg-a { font-style: italic; font-size: .98rem; line-height: 1.55; }
.detail .dlg-a b { font-style: normal; font-weight: 650; }

/* ================================================================ the exhibition (gallery of emotion stimuli) */
/* link under the hero */
.to-gallery { display: flex; align-items: baseline; gap: .9rem; justify-content: flex-end; margin: .4rem 0 1.4rem; padding: .7rem 0 .6rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
.to-gallery .tg-k { margin-right: auto; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.to-gallery .tg-t { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.to-gallery .tg-n { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.to-gallery .tg-a { font-size: 1.05rem; transition: transform .25s; }
.to-gallery:hover .tg-a { transform: translateX(4px); }

.exhibit { margin: 6rem calc(-1 * clamp(0px, (100vw - var(--measure)) / 2, 10rem)) 4rem; padding-top: 3rem; border-top: 1px solid var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
.ex-head { max-width: 46rem; }
.ex-kicker, .ex-num { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.ex-title { margin: .5rem 0 1rem; font: 700 clamp(2.1rem, 5vw, 3.4rem)/1.02 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; letter-spacing: -.035em; color: var(--ink); }
.ex-sub { font: 1.02rem/1.6 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; color: var(--ink-2); margin: 0 0 1.6rem; }
.ex-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.6rem; padding: .7rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ex-nav a { text-decoration: none; color: var(--ink); font-size: .86rem; font-weight: 600; }
.ex-nav a span { font-size: .62rem; letter-spacing: .12em; color: var(--ink-3); margin-right: .45rem; font-weight: 500; }
.ex-nav a:hover { color: var(--accent); }

.ex-room { margin-top: 4.2rem; scroll-margin-top: 1.5rem; }
.ex-room-h { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: 2rem; align-items: baseline; margin-bottom: 1.5rem; }
.ex-room-h .ex-num { grid-row: 1; padding-top: .3rem; border-top: 3px solid var(--room, var(--ink)); }
.ex-name { grid-row: 1; margin: 0; font: italic 600 clamp(1.9rem, 4vw, 2.6rem)/1 "Emotion Display", "Playfair Display", Georgia, serif; color: var(--ink); letter-spacing: -.005em; }
.ex-note { grid-column: 2; margin: .6rem 0 0; max-width: 38rem; font: .98rem/1.55 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; color: var(--ink-2); }

.ex-frame { position: relative; }
.ex-wall { display: flex; gap: 2.4rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .6rem .2rem 1.2rem; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 3rem), transparent); }
.ex-work { flex: 0 0 210px; margin: 0; scroll-snap-align: start; cursor: zoom-in; outline: none; }
.ex-img { aspect-ratio: 1; background: var(--surface-2); box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 14px 30px -14px rgba(0,0,0,.35); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.ex-img img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ex-work:hover .ex-img, .ex-work:focus-visible .ex-img { transform: translateY(-4px); box-shadow: 0 2px 2px rgba(0,0,0,.06), 0 22px 40px -16px rgba(0,0,0,.45); }
.ex-work:focus-visible figcaption .ex-t { text-decoration: underline; }
.ex-work figcaption { margin-top: .95rem; line-height: 1.35; }
.ex-t { font-size: .8rem; font-weight: 700; color: var(--ink); }
.ex-w { margin-top: .15rem; font: italic .86rem/1.35 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; color: var(--ink-2); }
.ex-s { margin-top: .35rem; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.ex-r { margin-top: .2rem; font-size: .7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ex-r i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: .4rem; vertical-align: 1px; }
.ex-series { flex: 0 0 auto; scroll-snap-align: start; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-start; gap: .35rem; width: 1.2rem;
  writing-mode: vertical-rl; transform: rotate(180deg); padding: .2rem 0; border-right: 1px solid var(--rule);
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.ex-series span { color: var(--ink); font-weight: 700; }
.ex-arrow { position: absolute; top: 105px; transform: translateY(-50%); z-index: 2; width: 2.2rem; height: 3.2rem; border: 0; padding: 0; background: none;
  font: 300 2.4rem/1 -apple-system, sans-serif; color: var(--ink-2); cursor: pointer; opacity: 0; transition: opacity .2s; }
.ex-frame:hover .ex-arrow { opacity: .75; }
.ex-arrow:hover { opacity: 1 !important; color: var(--ink); }
.ex-arrow.prev { left: -2.4rem; } .ex-arrow.next { right: -2.4rem; }
@media (max-width: 900px) { .ex-arrow { display: none; } }
@media (max-width: 640px) {
  .ex-room-h { grid-template-columns: 1fr; } .ex-room-h .ex-num { grid-row: auto; margin-bottom: .5rem; } .ex-name { grid-row: auto; } .ex-note { grid-column: 1; }
  .ex-work { flex-basis: 64vw; } .to-gallery .tg-k { display: none; }
}

/* the viewing room */
.ex-noscroll { overflow: hidden; }
.ex-lb { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 3rem 4.5rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; overflow-y: auto; }
.ex-lb.on { display: grid; animation: exfade .25s ease-out; }
@keyframes exfade { from { opacity: 0; } to { opacity: 1; } }
.ex-lb-in { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 340px); gap: 3.5rem; align-items: center; max-width: 960px; width: 100%; }
.ex-lb-img img { width: 100%; display: block; box-shadow: 0 2px 2px rgba(0,0,0,.06), 0 30px 60px -24px rgba(0,0,0,.5); }
.ex-lb-t { margin: .4rem 0 .2rem; font: 700 1.5rem/1.15 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; letter-spacing: -.02em; color: var(--ink); }
.ex-lb-meta { margin: .9rem 0 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); font-size: .78rem; line-height: 1.5; color: var(--ink-3); }
.ex-lb .dlg p { margin: 0 0 .5rem; }
.ex-lb .who { font: 700 .6rem/1 -apple-system, BlinkMacSystemFont, sans-serif; font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-right: .5rem; vertical-align: .12em; }
.ex-lb .dlg-q { font-size: .86rem; color: var(--ink-2); }
.ex-lb .dlg-a { font: italic .98rem/1.55 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; color: var(--ink); }
.ex-lb .dlg-a b { font-style: normal; font-weight: 650; }
.ex-lb-c { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; font-size: .78rem; color: var(--ink-2); }
.ex-lb-n { margin-top: 1.4rem; font-size: .66rem; letter-spacing: .14em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ex-lb-x, .ex-lb-nav { position: fixed; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-2); font-family: -apple-system, sans-serif; font-weight: 300; }
.ex-lb-x { top: 1rem; right: 1.4rem; font-size: 2.2rem; line-height: 1; }
.ex-lb-nav { top: 50%; transform: translateY(-50%); font-size: 3rem; line-height: 1; width: 3rem; height: 5rem; }
.ex-lb-nav.prev { left: .8rem; } .ex-lb-nav.next { right: .8rem; }
.ex-lb-x:hover, .ex-lb-nav:hover { color: var(--ink); }
@media (max-width: 760px) {
  .ex-lb { padding: 3.5rem 1.2rem 2rem; place-items: start center; }
  .ex-lb-in { grid-template-columns: 1fr; gap: 1.4rem; }
  .ex-lb-nav { top: auto; bottom: .4rem; transform: none; height: 3rem; }
}

/* one wall per series inside a room */
.ex-series-row { margin-top: 1.9rem; }
.ex-series-h { display: flex; align-items: baseline; gap: .8rem; padding-top: .65rem; border-top: 1px solid var(--rule); }
.ex-sn { font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); flex: none; min-width: 5.2rem; }
.ex-sname { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.ex-scount, .ex-count { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.ex-scount { margin-left: auto; }
.ex-count { margin-left: .4rem; white-space: nowrap; }
.ex-snote { margin: .3rem 0 .4rem 6rem; max-width: 40rem; font: italic .9rem/1.5 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; color: var(--ink-2); }
@media (max-width: 640px) { .ex-snote { margin-left: 0; } .ex-sn { min-width: 0; } }

/* gallery: a cue that a work opens, and rows that settle in when first seen */
.ex-hint { display: flex; align-items: center; gap: .5rem; margin: .9rem 0 0; font-size: .8rem; color: var(--ink-3); }
.ex-hint svg { width: 14px; height: 14px; flex: none; }
.ex-img { position: relative; }
.ex-cue { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  background: rgba(12, 13, 18, .46); color: #fff; text-align: center; padding: 1rem;
  opacity: 0; transition: opacity .25s; pointer-events: none; }
.ex-cue svg { width: 20px; height: 20px; margin-bottom: .15rem; }
.ex-cue b { font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.ex-cue span { font: italic .8rem/1.3 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; opacity: .9; }
.ex-work:hover .ex-cue, .ex-work:focus-visible .ex-cue { opacity: 1; }
.ex-series-row .ex-work { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 80ms); }
.ex-series-row.in .ex-work { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ex-series-row .ex-work { opacity: 1; transform: none; transition: none; } }
@media (hover: none) { .ex-cue { display: none; } }  /* touch readers get the line under the gallery title */

/* labels with MathML inside the loss diagram */
.flow .fo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1.15;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink); overflow: visible; }
.flow .fo math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "STIX Two Text", math; font-weight: normal; font-size: 1.14em; }
.flow .fo.name { font-size: 13px; font-weight: 600; }
.flow .fo.sub { font-size: 11.5px; color: var(--ink-2); }
.flow .fo.left { justify-content: flex-start; }
.flow .fo.accent { color: var(--accent); font-weight: 600; }
.flow .fo.big math, .flow .fo.frac math { font-size: 17px; }
.flow .fo.small math { font-size: 13px; }
.flow .fo.fo-note { font-size: 12px; }  /* not .note: that is the page's content-note box */

/* back to the blog listing (the page lives at eric2i.com/blog/<slug>/) */
.site-nav { margin: -1.4rem 0 2rem; font: .78rem -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: .04em; }
.site-nav a { color: var(--ink-3); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }

/* the exhibition banner above the hero (replaces the plain link when JavaScript runs) */
.teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; gap: 1.6rem;
  margin: .4rem calc(-1 * clamp(0px, (100vw - var(--measure)) / 2, 3.5rem)) 1.6rem; padding: 2rem 0 2rem 2.2rem; border-radius: 12px;
  background: var(--surface-2); color: var(--ink); text-decoration: none; overflow: hidden; isolation: isolate;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; transition: box-shadow .3s; }
.teaser:hover { box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .45); }
.tz-kicker { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.tz-title { margin: .5rem 0 .75rem; font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; line-height: 1.02; letter-spacing: -.035em; }
.tz-line { margin: 0 0 .9rem; max-width: 22rem; font: italic 1.02rem/1.45 Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif; color: var(--ink-2); }
.tz-emos { display: flex; flex-wrap: wrap; gap: .05rem .75rem; margin-bottom: 1.25rem; font: italic 600 1.08rem/1.3 "Emotion Display", "Playfair Display", Georgia, serif; }
.tz-cta { display: inline-flex; align-items: center; gap: .5rem; padding: .62rem 1.05rem; border-radius: 4px; background: var(--ink); color: var(--surface);
  font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.tz-cta b { font-weight: 400; transition: transform .25s; }
.teaser:hover .tz-cta b { transform: translateX(4px); }
.tz-wall { display: flex; flex-direction: column; gap: 14px; overflow: hidden; padding: .4rem 0 .9rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.tz-row { display: flex; gap: 14px; width: max-content; animation: tz-drift 90s linear infinite; }
.tz-row + .tz-row { animation-direction: reverse; animation-duration: 110s; margin-left: -64px; }
.tz-row img { width: 120px; height: 120px; display: block; object-fit: cover; border-radius: 2px; border-bottom: 3px solid var(--c);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 10px 22px -12px rgba(0, 0, 0, .45); }
.teaser:hover .tz-row { animation-play-state: paused; }
@keyframes tz-drift { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tz-row { animation: none; } }
@media (max-width: 720px) {
  .teaser { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.5rem 0 1.2rem 1.3rem; }
  .tz-row img { width: 92px; height: 92px; }
}

/* the top of the page (exhibition banner and 3D view): a little wider than the text, narrower than the other wide figures */
figure.wide:has(#space3d) { margin-left: calc(-1 * clamp(0px, (100vw - var(--measure)) / 2, 3.5rem)); margin-right: calc(-1 * clamp(0px, (100vw - var(--measure)) / 2, 3.5rem)); }
