/* koalajx — white ground, small type, photographs first. */
:root {
  --bg: #ffffff;
  --ink: #2b2b2b;
  --mute: #8a8a8a;
  --pad: 84px;                 /* outer margin (proposal setting: 56px x 1.5) */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (max-width: 900px) { :root { --pad: 40px; } }
@media (max-width: 560px) { :root { --pad: 22px; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 13px/1.55 var(--font); letter-spacing: .01em; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; -webkit-user-drag: none; }
h1 { font: inherit; margin: 0; }
.mute { color: var(--mute); }

/* header */
header.site { position: fixed; top: 0; left: 0; right: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; gap: 24px; padding: calc(var(--pad) * .55) var(--pad); }
header.site .name { font-weight: 500; margin-right: auto; }
.name { display: inline-flex; align-items: center; gap: 10px; }
.name .logo { width: 24px; height: 24px; object-fit: cover; border-radius: 3px; transition: transform .4s ease; }
.name:hover .logo { transform: rotate(-12deg); }
header.site nav a { margin-left: 22px; color: var(--mute); transition: color .2s; }
header.site nav a:hover, header.site nav a.on { color: var(--ink); }

/* home */
.home { min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; padding: var(--pad); color: var(--mute); }
.home p { margin: .2em 0; }
.home a { color: var(--ink); }

/* gallery overview: albums as offset stacks of prints */
.overview { padding: calc(var(--pad) * 1.9) var(--pad) var(--pad); }
.albums { display: grid; gap: calc(var(--pad) * 1.1) calc(var(--pad) * .9);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.album { display: block; }
.stack { position: relative; aspect-ratio: 4 / 3; }
.layer { position: absolute; inset: 8%; display: flex; align-items: center; justify-content: center; }
.layer img, .layer .paper { max-width: 100%; max-height: 100%; width: auto; height: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 2px 10px rgba(0,0,0,.06); transition: transform .35s ease; }
/* a loose pile: every album has its own tilts (--r0..--r2, set by build_site.py) */
.l0 img { transform: rotate(var(--r0, 0deg)); }
.l1 img { transform: translate(6px, -6px) rotate(var(--r1, 2deg)); }
.l2 img { transform: translate(12px, -10px) rotate(var(--r2, -2deg)); }
.layer img { transition: transform .45s cubic-bezier(.3, .7, .2, 1); }
/* albums page: small piles gathered in a narrow middle column */
.albums-page { max-width: calc(860px + var(--pad) * 2); margin: 0 auto; }
.albums-page .albums { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 44px 30px; }
.albums-page .stack { aspect-ratio: 5 / 4; }
.albums-page .layer { inset: 10%; }
.albums-page .l1 img { transform: translate(3px, -3px) rotate(var(--r1, 2deg)); }
.albums-page .l2 img { transform: translate(6px, -5px) rotate(var(--r2, -2deg)); }
.albums-page .album .cap { margin-top: .3em; font-size: 12px; color: var(--ink); }
.albums-page .album:hover .l0 img { transform: translateY(-3px) rotate(var(--r0, 0deg)); }
.albums-page .shelf-title { margin-bottom: 1.6em; }
.albums-page .shelf + .shelf { margin-top: 70px; }
.layer .paper { width: 100%; aspect-ratio: 3 / 2; background: #fff; display: flex; align-items: center;
  justify-content: center; color: var(--mute); font-style: italic; }
.album .cap { margin-top: calc(var(--pad) * .2); text-align: center; }

/* series: single-photo viewer */
.viewer { position: fixed; inset: 0; }
.viewer[hidden] { display: none; }
.stage { position: absolute; inset: calc(var(--pad) * 1.6) var(--pad); display: flex;
  align-items: center; justify-content: center; }
.stage img { max-width: min(100%, 1180px); max-height: 100%; width: auto; height: auto; object-fit: contain; }
.stage .textslide { max-width: 34em; max-height: 100%; overflow: auto; color: var(--ink); scrollbar-width: thin; scrollbar-color: #ddd transparent; }
.viewer.text .hit { width: 18%; }  /* leave the text column free for scrolling */
.stage .textslide p:first-child { margin-top: 0; }
.hit { position: absolute; top: 15%; bottom: 15%; width: 50%; z-index: 2; }
.hit.prev { left: 0; cursor: w-resize; }
.hit.next { right: 0; cursor: e-resize; }
.cap { color: var(--mute); }
.viewer .cap { position: absolute; left: var(--pad); right: var(--pad); bottom: calc(var(--pad) * .55);
  display: flex; justify-content: space-between; gap: 1em; z-index: 3; }
.viewer .cap a:hover { color: var(--ink); }
.viewer .back, .viewer .toindex { margin-right: 1.6em; }
.viewer .title { color: var(--mute); }
.viewer .title .mute { color: inherit; }

/* series: index (contact sheet) */
.index { padding: calc(var(--pad) * 1.9) var(--pad) var(--pad); }
.index[hidden] { display: none; }
.index .title { margin-bottom: calc(var(--pad) * .9); }
.grid { display: grid; gap: calc(var(--pad) * .8) calc(var(--pad) * .6);
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cell { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.cell img { max-width: 100%; max-height: 100%; width: auto; height: auto; transition: opacity .2s; }
.cell:hover img { opacity: .8; }
.cell.txt span { color: var(--mute); font-style: italic; }

/* text-only series */
.essay { max-width: 34em; margin: 0 auto; padding: calc(var(--pad) * 2) var(--pad) calc(var(--pad) * 1.5); }
.essay .title { margin-bottom: 2em; }
.essay .back { margin-top: 3em; color: var(--mute); }

@media (max-width: 560px) {
  header.site nav a { margin-left: 14px; }
  .stage { inset: calc(var(--pad) * 3.2) var(--pad) calc(var(--pad) * 4); }
  .viewer .cap { flex-direction: column; gap: .3em; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* albums: one shelf per gallery */
.shelf + .shelf { margin-top: calc(var(--pad) * 1.6); }
.shelf { scroll-margin-top: calc(var(--pad) * 1.6); }
.shelf-title { font: inherit; margin: 0 0 calc(var(--pad) * .6); }

/* experiments overview */
.exps { display: grid; gap: calc(var(--pad) * 1.1) calc(var(--pad) * .9);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.exp-card { display: block; }
.exp-cover { aspect-ratio: 3 / 2; background: #f4f4f2; overflow: hidden; }
.exp-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.exp-card:hover .exp-cover img { transform: scale(1.02); }
.exp-card .cap { margin-top: .9em; }
.exp-sum { margin: .3em 0 0; color: var(--mute); max-width: 36em; }

/* writing list */
.writing-list { max-width: 46em; }
.w-row { display: grid; grid-template-columns: 1fr auto; gap: .1em 1.5em; padding: 1.1em 0;
  border-top: 1px solid #eee; }
.w-row:last-child { border-bottom: 1px solid #eee; }
.w-row:hover .w-title { text-decoration: underline; text-underline-offset: 3px; }
.w-ex { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* articles */
.essay .text h2, .essay .text h3, .essay .text h4 { font: inherit; font-weight: 500; margin: 2.2em 0 .6em; }
.essay .text img { max-width: 100%; height: auto; }
.essay .text figure { margin: 2em 0; }
.essay .text blockquote { margin: 1.4em 0; padding-left: 1.2em; border-left: 1px solid #ddd; color: var(--mute); }
.essay .text a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #ccc; }
.essay .text hr { border: 0; border-top: 1px solid #eee; margin: 2.4em 0; }

/* experiment pages share the margins; each experiment brings its own exp.css */
.experiment { padding: calc(var(--pad) * 1.9) var(--pad) var(--pad); }

/* home: the photo library (every photograph as a small print) */
.home-lib { padding: calc(var(--pad) * 1.6) var(--pad) calc(var(--pad) * 1.5); }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.wall .ph { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.wall img { width: 74%; height: 74%; object-fit: contain; transition: opacity .25s, transform .15s, width .9s, height .9s; }
.wall.js { display: block; position: relative; }
.wall.js .ph { position: absolute; left: 0; top: 0; aspect-ratio: auto; }
.wall.ready .ph { transition: transform .9s cubic-bezier(.3, .7, .2, 1), width .9s, height .9s; }
.wall[data-mode=likeness] img { width: 92%; height: 92%; }
.wall[data-mode=likeness] .ph:hover { z-index: 3; }
.wall[data-mode=likeness] .ph:hover img { transform: scale(3.4); box-shadow: 0 2px 14px rgba(0,0,0,.2); }
.wall.hov .ph img { opacity: .14; }
.wall.hov .ph.same img { opacity: 1; }
.wall-cap { position: fixed; z-index: 4; left: var(--pad); right: var(--pad); bottom: calc(var(--pad) * .45);
  display: flex; justify-content: space-between; color: var(--mute); pointer-events: none; }
.wall-cap > span { background: var(--bg); padding: .15em .5em .15em 0; }
.wall-cap .arr { pointer-events: auto; padding: .15em 0 .15em .5em; }
.wall-cap .arr a { margin-left: 1.2em; cursor: pointer; }
.wall-cap .arr a.on, .wall-cap .arr a:hover { color: var(--ink); }

/* layout variant B · catalogue (local only, /_try/catalogue/) */
.lay-catalogue .ix { position: fixed; top: 0; bottom: 0; left: 0; width: 260px; overflow: auto; z-index: 5;
  padding: calc(var(--pad) * .55) 1.5em var(--pad) var(--pad); scrollbar-width: none; background: var(--bg); }
.lay-catalogue .ix .name { display: flex; font-weight: 500; margin-bottom: 2.6em; }
.ix-g { margin-bottom: 2.2em; }
.ix-g h2 { font: inherit; color: var(--mute); margin: 0 0 .6em; }
.ix-g a { display: block; line-height: 1.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-g a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #bbb; }
.lay-catalogue .home-lib { margin-left: 260px; padding-top: calc(var(--pad) * .55); }
.lay-catalogue .wall-cap { left: calc(260px + var(--pad)); }
@media (max-width: 800px) {
  .lay-catalogue .ix { position: static; width: auto; columns: 2; }
  .lay-catalogue .home-lib { margin-left: 0; }
  .lay-catalogue .wall-cap { left: var(--pad); }
}

/* layout variant C · label (local only, /_try/label/) */
.lay-label header.label { position: fixed; z-index: 5; left: var(--pad); bottom: calc(var(--pad) * .45);
  background: var(--bg); padding: .5em 1em .2em 0; }
.lay-label header.label .name { display: flex; font-weight: 500; margin-bottom: .2em; }
.lay-label header.label nav a { color: var(--mute); margin-right: 1.3em; }
.lay-label header.label nav a:hover { color: var(--ink); }
.lay-label .home-lib { padding-top: calc(var(--pad) * .8); padding-bottom: calc(var(--pad) * 2.2); }
.lay-label .wall-cap { left: auto; gap: 1.5em; }

/* experiments are objects: one made thing per page, a label under it, one paragraph about it */
.obj { max-width: 1240px; margin: 0 auto; }
.obj-stage { position: relative; height: calc(100vh - var(--pad) * 3.9); min-height: 380px; }
.obj-label { display: flex; justify-content: space-between; align-items: baseline; gap: 2em; margin-top: 1.3em; color: var(--mute); }
.obj-label .t { color: var(--ink); }
.obj-label .now { text-align: right; }
.obj-label .now a { color: var(--ink); }
.obj-about { max-width: 36em; margin-top: calc(var(--pad) * 1.1); color: var(--mute); }
.obj-about p { margin: .6em 0; }
.obj-about a { color: var(--ink); }
.obj .fit { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.obj .fade { transition: opacity 1.6s ease; }
/* experiments index: smaller, gathered */
.exps-page { max-width: calc(1000px + var(--pad) * 2); margin: 0 auto; }
.exps-page .exps { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 54px 34px; }
.exps-page .exp-sum { font-size: 12px; }

/* experiment objects: shared bits */
.obj-stage.dark { background: #0b0b0b; }
.obj-stage.dark .fit { cursor: pointer; }
.obj-hint { color: var(--mute); }

.albums .cap .meta { display: block; margin-top: 2px; }
.albums .dbar { display: flex; height: 5px; width: 82%; margin: 0 auto 6px; }
.albums .dbar i { flex: 1 1 0; min-width: 1px; }
.albums .dcode { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; letter-spacing: .04em; }

/* experiment controls: ‹ pause › under the stage, drawn in CSS so they stay hairline-thin */
.obj-ctl { display: inline-flex; flex: none; margin-right: -9px; align-self: center; }
.obj-ctl button { position: relative; width: 34px; height: 30px; padding: 0; border: 0; background: none;
  color: var(--mute); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.obj-ctl button:hover { color: var(--ink); }
.obj-ctl .prev::before, .obj-ctl .next::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  border: solid currentColor; border-width: 0 0 1.4px 1.4px; }
.obj-ctl .prev::before { transform: translate(-25%, -50%) rotate(45deg); }
.obj-ctl .next::before { transform: translate(-75%, -50%) rotate(-135deg); }
.obj-ctl .pause::before, .obj-ctl .pause::after { content: ""; position: absolute; top: 50%; width: 1.6px; height: 11px;
  background: currentColor; transform: translateY(-50%); }
.obj-ctl .pause::before { left: calc(50% - 3.5px); }
.obj-ctl .pause::after { left: calc(50% + 2px); }
.obj-ctl .pause.paused::before { left: calc(50% - 3px); width: 0; height: 0; background: none;
  border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; }
.obj-ctl .pause.paused::after { display: none; }

/* home: two doors */
.front { display: grid; grid-template-columns: 1fr 1fr; gap: 0 calc(var(--pad) * .8);
  padding: calc(var(--pad) * 1.6) var(--pad) calc(var(--pad) * .8); }
.door-img { position: relative; display: block; height: calc(100vh - var(--pad) * 3.7); min-height: 300px; }
.door-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 1.4s ease; }
.door-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em 1em; margin-top: 1.1em; }
.door-t { font-weight: 500; }
.door-t .arrow { display: inline-block; transition: transform .25s ease; }
.door-t:hover .arrow { transform: translateX(4px); }
.door-now { margin-left: auto; color: var(--mute); }
.door-now a { color: var(--ink); }
.front-more { grid-column: 1 / -1; text-align: center; margin: calc(var(--pad) * .7) 0 0; }
.front-more a { color: var(--ink); }

/* phones */
@media (max-width: 700px) {
  .front { grid-template-columns: 1fr; padding-top: calc(var(--pad) * 1.1 + 48px); }
  .door + .door { margin-top: 2.6em; }
  .door-img { height: auto; aspect-ratio: 4 / 3; min-height: 0; }
  .door-cap { margin-top: .7em; }
  .door-now { margin-left: 0; flex-basis: 100%; }
  .experiment { padding-top: calc(var(--pad) * 1.1 + 48px); }
  .obj-stage { height: 62vh; height: 62svh; min-height: 280px; }
  .obj-label { flex-wrap: wrap; gap: .25em 1em; margin-top: .9em; }
  .obj-label > span:first-child { flex-basis: 100%; }
  .obj-label .now { flex: 1; text-align: left; min-width: 0; }
  .obj-ctl { margin-left: auto; }
  .obj-ctl button { width: 44px; height: 40px; }
  .obj-about { margin-top: 1.8em; }
  .overview, .index, .home-lib { padding-top: calc(var(--pad) * 1.1 + 48px); }
  .exps-page .exps { grid-template-columns: 1fr 1fr; gap: 34px 18px; }
  .albums-page .albums { grid-template-columns: 1fr 1fr; gap: 30px 18px; }
}

/* Photo page: one gallery at a time, picked by plain words; the chosen one is underlined in the banana's yellow */
.ptabs { display: flex; gap: 2.2em; margin-bottom: calc(var(--pad) * .8); }
.ptabs a { padding: .2em 0; color: var(--mute); border-bottom: 1.5px solid transparent; transition: color .2s, border-color .2s; }
.ptabs a:hover { color: var(--ink); }
.ptabs a.on { color: var(--ink); border-bottom-color: #d9a520; }
.ptabs .n { margin-left: .45em; color: var(--mute); font-size: 11px; }
.tabbed .albums-page .shelf-title { display: none; }
.tabbed .albums-page .shelf + .shelf { margin-top: 0; }
.albums-page .shelf[hidden] { display: none; }

/* album cards: one print lying straight, with a sheet or two edged out behind it (two when the album is large) */
.albums-page .stack { display: flex; align-items: center; justify-content: center; }
.print { position: relative; }
.print img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.08); transition: transform .5s cubic-bezier(.3, .7, .2, 1); }
.print::before, .print::after { content: ""; position: absolute; inset: 0; background: #f6f6f4;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06); transition: transform .5s cubic-bezier(.3, .7, .2, 1); }
.print::before { z-index: 1; transform: translate(5px, -5px); }
.print::after { z-index: 0; transform: translate(10px, -10px); }
.print.few::after { display: none; }
.album:hover .print img { transform: translate(-2px, 2px); }
.album:hover .print::before { transform: translate(7px, -7px); }
.album:hover .print::after { transform: translate(14px, -14px); }
