:root {
  --bg: #fff;
  --ink: #111;
  --muted: #8a8a85;
  --line: rgba(0, 0, 0, 0.1);
  --blue: #1a1aff;
  --pink: #ff4f9a;
  /* Type: bold grotesk for titles; subtitles and labels in mono */
  --sans: "Helvetica Neue", Helvetica, "Inter Tight", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --panel-w: min(560px, 100vw);
}
@media (max-width: 600px) { :root { --panel-w: 100vw; } }
/* big screens: the panel takes 45% so wide pieces have room */
@media (min-width: 1245px) { :root { --panel-w: 45vw; } }

* { box-sizing: border-box; }

html, body {
  cursor: var(--cursor, auto);
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: var(--cursor-pointer, pointer);
}
a { cursor: var(--cursor-pointer, pointer); }

/* ── Wall: a Tillmans hang ─────────────────────────────
   Prints of very different sizes on a white wall: no frames, a hairline
   shadow where the paper lifts off the wall. */

#wall {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #fff;
  cursor: var(--cursor, grab);
  /* phones: pinch-zoom the page (one finger still drags the wall); once
     zoomed in, one finger pans around the zoomed page */
  touch-action: pinch-zoom;
  user-select: none;
  transition: filter 0.6s ease, transform 1.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease;
}
body.zoomed #wall { touch-action: auto; }
#wall.dragging { cursor: var(--cursor, grabbing); }
body.intro #wall { opacity: 0; transform: scale(1.12); filter: blur(18px); }
body.panel-open #wall,
body.lightbox-open #wall { filter: blur(10px); }
body.grid-open #wall { visibility: hidden; }

/* While a piece is hovered the rest of the wall steps back; only that
   project's pieces stay bright. */
#wall .tile {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  will-change: transform;
  transition: opacity 0.35s ease;
}
#wall .tile:hover { z-index: 5; }
body.hovering #wall .tile { opacity: 0.18; }
body.hovering #wall .tile.lit { opacity: 1; }

.piece { position: absolute; inset: 0; display: block; }
.piece img,
.piece video {
  display: block;
  max-width: calc(100% - 44px);
  max-height: calc(100% - 64px);
  object-fit: contain;
  cursor: var(--cursor-pointer, pointer);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-user-drag: none;
}
.piece img.loaded,
.piece video.loaded { opacity: 1; }
#wall .tile .piece > img,
#wall .tile .piece > video,
#wall .tile .piece > .typeflip,
#wall .tile .piece > .pair,
#wall .tile .piece > .blocks,
#wall .tile .piece > .swap,
#wall .tile .piece > .specimen,
#wall .tile .piece > .kerncard {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  box-shadow: 0 1px 1.5px rgba(40, 30, 20, 0.16), 0 6px 14px rgba(40, 30, 20, 0.06);
}
#wall .tile .piece > .pair { display: flex; gap: 4%; box-shadow: none; } /* two prints side by side */
#wall .tile .piece > .pair img { flex: 1 1 0; min-width: 0; width: auto; height: 100%; object-fit: cover; box-shadow: 0 1px 1.5px rgba(40, 30, 20, 0.16), 0 6px 14px rgba(40, 30, 20, 0.06); }
#wall .tile .piece > .swap img { width: 100%; height: 100%; object-fit: cover; }
#wall .tile .piece > .book3d { box-shadow: none; }
#wall .tile .piece > .stopmotion,
#wall .tile .piece > .piece-slot { display: block; width: 100%; height: 100%; } /* slot: built once on screen */
/* Pieces shot on white sit straight on the wall, no shadow box around them */
#wall .tile.on-white .piece > img,
#wall .tile.on-white .piece > .blocks { box-shadow: none; }

/* The little mono title under each print. Long titles trim to fit the print's
   width so neighbours never collide; hover shows the whole thing. */
.piece figcaption {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  margin: 0;
  max-width: calc(100% + 10px);
  overflow: hidden;
  text-overflow: ellipsis;
  font: 9px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0.75;
  pointer-events: none;
}
#wall .tile:hover .piece figcaption {
  z-index: 2;
  max-width: none;
  overflow: visible;
  padding-right: 4px;
  background: #fff;
  opacity: 1;
}

/* ?labels mode: filenames for editing projects.js */
.label {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 2px 5px;
  background: #ff0;
  color: #000;
  font: 11px/1.2 ui-monospace, Menlo, monospace;
  white-space: nowrap;
  pointer-events: none;
}
figure { position: relative; margin: 0; }
figure .label { bottom: 8px; }

/* ── Corners: type on black label-tape strips ─────────
   Each line its own strip, stacked flush to the same left edge, under the logo. */

.corner {
  position: fixed;
  z-index: 20;
  padding: 0;
  color: var(--ink);
  font: 800 14px/1 var(--sans);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, opacity 0.8s ease 0.4s;
}
.tl { top: 16px; left: 18px; }
.tr { top: 16px; right: 18px; }
body.intro .corner { opacity: 0; pointer-events: none; transition-delay: 0s; }
.corner .hl, #viewSwitch .hl {
  display: inline-block;
  padding: 4px 7px 3px 6px;
  background: #0b0b0b;
  color: #fff;
  transition: background 0.15s, color 0.15s;
}
.corner:hover .hl, .corner.active .hl { background: var(--pink); }
/* Top left: the logo beside the name and role, their tops and bottoms flush. The logo
   is white and inverts against the wall, so it reads black on white and light on dark work. */
:root { --logo-w: 103px; }
#logoBtn { mix-blend-mode: difference; line-height: 0; }
#logoBtn svg { display: block; width: var(--logo-w); height: auto; }
#homeBtn { left: calc(18px + var(--logo-w) + 7px); text-align: left; }
#homeBtn .tl-sub { display: block; margin-top: 2px; font: 400 10.5px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
#homeBtn .tl-sub .hl { padding: 3px 6px 2px; }

/* View switch (Gallery / Grid): two strips; the one you're on is bright */
#viewSwitch { position: fixed; z-index: 21; top: 16px; left: max(50%, 432px); transform: translateX(-50%); display: flex; gap: 2px; transition: opacity 0.8s ease 0.4s; }
#viewSwitch :is(button, a) { font: 500 12px/1 var(--sans); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
#viewSwitch :is(button, a) .hl { color: #8d8d8d; }
#viewSwitch .on .hl { color: #fff; }
#viewSwitch :is(button, a):not(.on):hover .hl { color: #fff; background: var(--pink); }
/* Post Office isn't a way to see the work, so it sits a little apart, with a
   little line-drawn envelope in front */
#viewSwitch .po { margin-left: 16px; }
#viewSwitch .po .hl { display: inline-flex; align-items: center; gap: 6px; color: #fff; }
#viewSwitch .po .stamp { width: 15px; height: 11px; background: var(--pink); transition: background 0.15s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='11' viewBox='0 0 15 11' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Crect x='.8' y='.8' width='13.4' height='9.4'/%3E%3Cpath d='M1 1.2l6.5 5 6.5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='11' viewBox='0 0 15 11' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Crect x='.8' y='.8' width='13.4' height='9.4'/%3E%3Cpath d='M1 1.2l6.5 5 6.5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
#viewSwitch .po:hover .stamp { background: #fff; }
body.intro #viewSwitch { opacity: 0; pointer-events: none; transition-delay: 0s; }

@media (max-width: 560px) {
  .corner { font-size: 12.5px; }
  :root { --logo-w: 95px; }
  .tl, .tr { top: 15px; }
  #homeBtn { left: calc(18px + var(--logo-w) + 6px); }
  #homeBtn .tl-sub { font-size: 9px; }
}
/* Narrow: the switch moves to the empty bottom-left corner */
@media (max-width: 680px) {
  #viewSwitch { top: auto; bottom: 14px; left: 18px; transform: none; }
  #viewSwitch :is(button, a) { font-size: 12px; }
  #viewSwitch .hl { padding: 6px 9px 5px 8px; } /* closer to the Post Office page's buttons */
  #viewSwitch .po { margin-left: 10px; }
}

/* Wide screens: with a project panel open, Info and the switch slide left so
   they stay visible beside it. They never overlap the name: the switch keeps
   16px from the role strip (it ends ~290px in) and hides when the room left of
   the panel is too tight; Info only moves over when there is space for it. */
@media (min-width: 681px) {
  .tr, #viewSwitch { transition: right 0.55s cubic-bezier(0.16, 1, 0.3, 1), left 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease; }
  body.panel-open #viewSwitch { opacity: 0; pointer-events: none; }
}
@media (min-width: 820px) {
  body.panel-open .tr { right: calc(var(--panel-w) + 18px); }
}
@media (min-width: 1110px) {
  body.panel-open #viewSwitch { opacity: 1; pointer-events: auto; left: max(calc((100vw - var(--panel-w)) / 2), 432px); }
}
/* Full-page projects: the header stays put, Info in its corner, the switch in the middle */
@media (min-width: 681px) {
  body.panel-full.panel-open .tr { right: 18px; }
  body.panel-full.panel-open #viewSwitch { opacity: 1; pointer-events: auto; left: max(50%, 432px); }
}

/* ── Hovering a piece: its title, huge, with the type in small mono under it ── */

#hoverTitle,
#hoverScript {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#hoverTitle { mix-blend-mode: difference; }
#hoverTitle.on,
#hoverScript.on { opacity: 1; }
#hoverTitle b {
  max-width: 94vw;
  color: #fff;
  font: 800 clamp(56px, 12.5vw, 210px)/0.84 var(--sans);
  letter-spacing: -0.06em;
  text-align: center;
  text-transform: uppercase;
}
/* The pink line starts just under the title's real bottom edge (measured in
   gallery.js), so it never overlaps, even when a title runs to two lines. */
#hoverScript { z-index: 16; justify-content: flex-start; padding-top: calc(var(--title-bottom, 58vh) + 16px); }
#hoverScript i {
  display: inline-block;
  max-width: 86vw;
  font: 400 clamp(12px, 1.2vw, 17px)/1.5 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  color: var(--pink);
  text-shadow: 0 0 2px #fff, 0 0 8px #fff;
}
#hoverTitle.on b { animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.2, 1); }
#hoverScript.on i { animation: scrawl 0.6s cubic-bezier(0.2, 0.9, 0.2, 1); }
@keyframes rise { from { transform: translateY(18%); opacity: 0; } }
@keyframes scrawl { from { transform: rotate(-12deg) scale(0.85); opacity: 0; } }
body.intro #hoverTitle,
body.panel-open #hoverTitle,
body.lightbox-open #hoverTitle,
body.intro #hoverScript,
body.panel-open #hoverScript,
body.lightbox-open #hoverScript { opacity: 0; }

/* ── Panel ────────────────────────────────────────── */

#panel {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--panel-w);
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: -1px 0 0 var(--line);
}
body.panel-open #panel { transform: none; }

.panel-close,
.panel-expand { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; }
.panel-close { font-size: 22px; line-height: 44px; }
.panel-close:hover, .panel-expand:hover { color: var(--blue); }
/* Full-screen button beside the ×; phones already get the whole screen */
.panel-expand { display: grid; place-items: center; }
.panel-expand svg { width: 17px; height: 17px; }
.panel-expand .i-shrink, body.panel-full .panel-expand .i-grow { display: none; }
body.panel-full .panel-expand .i-shrink { display: block; }
.panel-expand { display: none !important; } /* projects are always full page, Info always a side panel */

.panel-inner { padding: 14px 20px 60px; }
.kern { letter-spacing: 0; } /* see kernTitle in gallery.js */
.panel-inner h2 {
  margin: 0;
  font: 800 clamp(40px, 6vw, 64px)/0.9 var(--sans);
  letter-spacing: -0.05em;
  text-wrap: balance;
}
/* Subtitles everywhere (panel, sections, grid, Info, hover): small spaced-out
   mono capitals in pink */
.panel-inner .type { margin: 10px 0 24px 2px; font: 400 13px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); text-wrap: balance; }
.panel-inner .desc {
  margin: 0 0 32px;
  max-width: 46ch;
  font: 16px/1.45 var(--sans);
  letter-spacing: -0.005em;
  white-space: pre-line;
  text-wrap: pretty;
}
/* The bold one-liner on what a project is, right above its description */
.panel-inner .summary { margin: 0 0 8px; max-width: 46ch; font: 700 16px/1.4 var(--sans); letter-spacing: -0.01em; }
body.panel-full .p-head .summary { max-width: 34ch; }
/* A bio in more than one paragraph: a line's space between them */
.panel-inner .desc:has(+ .desc) { margin-bottom: 1.45em; }
.panel-inner .media { display: flex; flex-direction: column; gap: 10px; }
.panel-inner .media img,
.panel-inner .media video { width: 100%; display: block; }
.panel-inner .media .specimen,
.panel-inner .media .kerncard,
.panel-inner .media .stopmotion { margin-bottom: 10px; }
.panel-inner .media .book3d { margin-bottom: 8px; }
.panel-inner .media .pair { gap: 10px; }
.panel-inner a { color: inherit; }
.panel-inner a:hover { color: var(--blue); }
/* Small-print credit line at the end of a project (and under groups inside it) */
.panel-inner .credit { margin: 6px 0 22px; font: 10.5px var(--mono); letter-spacing: 0.03em; color: var(--muted); text-transform: uppercase; }
.panel-inner .credit a { text-decoration: underline; text-underline-offset: 2px; }
.panel-inner .credit a:hover { color: var(--pink); }
.panel-inner .media .m-note { margin: -4px 0 10px; }
.panel-inner .media .m-cap { margin: -2px 0 12px; max-width: 62ch; font: 400 14px/1.5 var(--sans); color: var(--ink); text-wrap: pretty; } /* hugs the image above, clear of the one below */
/* A section inside a project (e.g. w/ LOLO → Window Display): a smaller
   version of the panel's own title, subhead and paragraph */
.panel-inner .media .m-section { margin: 54px 0 8px; padding-top: 22px; border-top: 1px solid #e4e4e0; }
.panel-inner .m-section h3 { margin: 0; font: 800 clamp(30px, 4.2vw, 44px)/0.92 var(--sans); letter-spacing: -0.05em; }
.panel-inner .m-section .type { margin: 6px 0 16px 2px; font-size: 12px; }
.panel-inner .m-section .desc { margin: 0 0 8px; }
.panel-inner .media .m-label { margin: 30px 0 2px; font: 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.panel-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font: 800 14px var(--sans);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.panel-nav button:hover { color: var(--blue); }

/* Full screen is its own layout, built for the work: the title, subhead and
   summary sit in a pinned column on the left, and every piece runs as big as
   the screen allows on the right, each kept within the screen height so it is
   always seen whole. The column is wide enough, and its type small enough,
   that no title can run into the work. */
body.panel-full { --panel-w: 100vw; }
/* A project is its own page: it fades in below a white header band that holds the
   logo, name, switch and Info, with no × or full-screen button */
:root { --head-h: 66px; }
@media (max-width: 560px) { :root { --head-h: 62px; } }
body.panel-full #panel { top: var(--head-h); z-index: 19; box-shadow: none; transform: none; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s; }
body.panel-full.panel-open #panel { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
body.panel-full::before { content: ""; position: fixed; z-index: 19; top: 0; left: 0; right: 0; height: var(--head-h); background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
body.panel-full.panel-open::before { opacity: 1; }
body.panel-full .panel-close, body.panel-full .panel-expand { display: none; }
/* ── A project page ──────────────────────────────────
   Everything hangs from one left edge, the same edge as the logo, so the
   title, the words and the work all line up with the header. The title runs
   big, the words are set to be read, and the work fills the width below,
   never taller than the screen. */
body.panel-full .panel-inner:has(.p-head) { --gut: 18px; padding: 36px var(--gut) 96px; }
body.panel-full .p-head { margin: 0 0 56px; }
.p-head h2 { padding-bottom: 14px; border-bottom: 1px solid var(--line); } /* a rule under the title, as on the resume */
body.panel-full .p-head h2 { padding-bottom: 22px; }
body.panel-full .p-head h2 { margin: 0 0 0 -0.04em; font: 800 clamp(56px, 10vw, 184px)/0.86 var(--sans); letter-spacing: -0.055em; text-wrap: balance; }
body.panel-full .p-head .type { margin: 18px 0 40px; font-size: 13px; }
body.panel-full .p-head .summary { max-width: 30ch; margin: 0 0 16px; font: 700 clamp(22px, 2vw, 30px)/1.2 var(--sans); letter-spacing: -0.025em; }
body.panel-full .p-head .desc { max-width: 52ch; margin: 0; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; }

body.panel-full .p-body .media { gap: 18px; align-items: flex-start; } /* pieces keep their own shape, never stretched */
body.panel-full .p-body .media > * { margin: 0; }
body.panel-full .p-body .media > :is(img, video) { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - var(--head-h) - 36px); object-fit: contain; }
body.panel-full .p-body .media > :is(.pair, .blocks, .typeflip, .stopmotion, .swap, .specimen, .kerncard) { width: 100%; }
body.panel-full .p-body .media > .swap { max-width: calc((100vh - var(--head-h) - 36px) * 0.7); }
body.panel-full .p-body .media > .specimen { max-width: calc((100vh - var(--head-h) - 36px) * 1000 / 1400); }
body.panel-full .p-body .media > .book3d { width: min(100%, calc((100vh - var(--head-h)) * 0.8)); }
body.panel-full .panel-inner .media .pair { gap: 18px; }
body.panel-full .p-body .book { max-width: 100%; margin-bottom: 18px; }
/* The flip-through as big as the screen allows: the open spread plus its bar fit in one view */
body.panel-full .p-body .media > .book { width: min(100%, calc((100vh - var(--head-h) - 120px) * var(--ar, 1.35))); }
/* Sections inside a project (w/ LOLO → Window Display) start like small pages */
body.panel-full .panel-inner .media .m-section { margin: 72px 0 6px; padding-top: 18px; }
body.panel-full .panel-inner .m-section h3 { font-size: clamp(32px, 4.4vw, 72px); }
body.panel-full .panel-inner .m-section .desc { max-width: 52ch; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; }
body.panel-full .panel-inner .media .m-label { margin: 40px 0 0; }
body.panel-full .panel-inner .credit { margin: 18px 0 0; }
body.panel-full .panel-inner .media .m-note { margin: -10px 0 16px; }
body.panel-full .panel-inner .media .m-cap { margin: -8px 0 22px; font-size: 15px; }
body.panel-full .panel-nav { margin-top: 72px; font-size: clamp(14px, 1.4vw, 20px); }
@media (max-width: 760px) {
  body.panel-full .panel-inner:has(.p-head) { padding: 24px var(--gut) 64px; }
  body.panel-full .p-head { margin-bottom: 36px; }
  body.panel-full .p-head .type { margin: 12px 0 24px; font-size: 11px; }
  body.panel-full .p-body .media { gap: 12px; }
  body.panel-full .panel-inner .media .m-note { margin: -6px 0 12px; }
  body.panel-full .panel-inner .media .m-cap { margin: -4px 0 16px; font-size: 14px; }
  body.panel-full .p-body .media > * { max-width: 100% !important; }
  body.panel-full .p-body .media > :is(img, video) { width: 100%; max-height: none; }
  body.panel-full .panel-inner .media .pair { gap: 12px; }
}

/* "Concept": a small outlined tag beside a school project's type */
.concept { display: inline-block; margin-left: 8px; padding: 2px 5px 1px; border: 1px solid currentColor; color: var(--muted); font: 400 0.85em/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 0.1em; white-space: nowrap; }

/* ── Info ─────────────────────────────────────────── */

/* Info is its own side panel that slides over whatever is open */
#infoPanel { position: fixed; z-index: 34; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: -1px 0 0 var(--line); transform: translateX(100%); transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
/* it stays this narrow on big screens too, so the bio fills it edge to edge */
#infoPanel .panel-inner .desc { max-width: none; }
body.info-open #infoPanel { transform: none; }
#infoScrim { position: fixed; z-index: 33; inset: 0; background: rgba(255, 255, 255, 0.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease; cursor: var(--cursor-pointer, pointer); }
body.info-open #infoScrim { opacity: 1; pointer-events: auto; }
#infoPanel .panel-close { display: block; }

/* What I'm doing rn: top of Info, driven by SCHEDULE in projects.js */
.panel-inner .rn { margin: 0 0 26px; padding: 16px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rn-label { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 11px var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.rn-label span { margin-left: auto; color: var(--muted); }
.rn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); animation: rnPulse 1.8s ease-in-out infinite; }
@keyframes rnPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 79, 154, 0.55); } 60% { box-shadow: 0 0 0 7px rgba(255, 79, 154, 0); } }
.rn-now { margin: 0; font: 800 30px/1.05 var(--sans); letter-spacing: -0.035em; text-wrap: balance; }
@media (prefers-reduced-motion: reduce) { .rn-dot { animation: none; } }
/* disciplines under the bio */
.panel-inner .disciplines { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 4px 0 22px; font: 11px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.panel-inner .disciplines span:not(:last-child)::after { content: "·"; margin: 0 9px; color: var(--pink); }
/* "wanna make something together?" box with email / Instagram / LinkedIn icons */
.hello { margin: 34px 0 10px; padding: 20px 20px 18px; border: 1px solid #e4e4e0; }
.hello-head { margin: 0; font: 800 22px/1.05 var(--sans); letter-spacing: -0.04em; }
.hello-script { margin: 6px 0 14px; font: 400 13px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }
.panel-inner .links { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.panel-inner .links a { display: inline-flex; width: 24px; height: 24px; color: var(--ink); transition: color 0.2s, transform 0.2s; }
.panel-inner .links a svg { width: 100%; height: 100%; }
.panel-inner .links a:hover { color: var(--pink); transform: translateY(-1px); }

/* ── Grid view: one cover per project ─────────────── */

#gridView {
  position: fixed;
  inset: 0;
  z-index: 18;
  overflow-y: auto;
  background: var(--bg);
  padding: 72px 18px 80px; /* clears the logo and name */
  transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}
#gridView[hidden] { display: none; }
/* Home (your name): the grid steps back for the confetti, then returns when it
   bursts, the same way the gallery wall does */
body.intro #gridView { opacity: 0; transform: scale(1.04); pointer-events: none; transition-duration: 0.3s; }
/* an open project (or the lightbox) blurs the grid behind it, like the wall */
body.panel-open #gridView,
body.lightbox-open #gridView { filter: blur(10px); }
.g-covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px 18px; }
.g-tile { display: flex; flex-direction: column; gap: 7px; text-align: left; }
/* square cards, each piece shown whole */
.g-media { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.g-media img, .g-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.35s ease; }
/* Hovering a tile fades the rest back, the same as hovering on the wall */
@media (hover: hover) {
  .g-covers:has(.g-tile:hover) .g-tile:not(:hover) :is(.g-media img, .g-media video) { opacity: 0.2; }
  .g-covers:has(.g-tile:hover) .g-tile:not(:hover) .g-cap { opacity: 0.3; }
}
/* title, then the type always on its own line below */
.g-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 1em; margin-top: 4px; font: 11px/1.2 var(--mono); color: var(--ink); transition: opacity 0.35s ease; }
.g-cap b { font: 800 20px/1.05 var(--sans); letter-spacing: -0.04em; }
.g-cap span { flex-basis: 100%; margin-top: 4px; font: 400 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }
.g-tile:hover .g-cap b { color: var(--pink); }
@media (max-width: 900px) { .g-covers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  #gridView { padding: 64px 14px 80px; }
  .g-covers { grid-template-columns: 1fr; gap: 32px; }
}

/* Phones: an open panel or lightbox covers the whole screen, so hide what's
   behind it instead of blurring it (a full-screen blur over ~80 pieces runs
   Safari on iPhone out of memory), and fade the wall in without the big blur. */
@media (max-width: 560px) {
  body.intro #wall { filter: none; }
  #wall { transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease; }
  body.panel-open #wall,
  body.lightbox-open #wall,
  body.panel-open #gridView,
  body.lightbox-open #gridView { visibility: hidden; filter: none; transition: none; }
}

/* ── Confetti intro ───────────────────────────────── */

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  cursor: var(--cursor-pointer, pointer);
}
body:not(.intro) #confetti { pointer-events: none; }

#hint {
  position: fixed;
  z-index: 41;
  left: 0;
  right: 0;
  bottom: 28px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: opacity 0.4s ease;
  animation: bob 2.4s ease-in-out infinite;
}
body:not(.intro) #hint { opacity: 0; }

/* Copyright: only at the very end of pages you scroll (the grid, Info and each
   project), never on the gallery wall */
#gridView::after,
.panel-inner::after {
  content: "© 2026 Lauren Arabia";
  display: block;
  grid-column: 1 / -1;
  margin-top: 48px;
  font: 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes bob { 50% { transform: translateY(-4px); } }

/* While the wall gets ready: a few punched discs drift down. It fades in after
   0.4s (in CSS, so it still runs while the page is busy); a quick load never shows it. */
#waiting { position: fixed; inset: 0; z-index: 25; pointer-events: none; opacity: 0; animation: waitIn 0.4s ease 0.4s forwards; }
#waiting.gone { animation: waitOut 0.5s ease forwards; }
@keyframes waitIn { to { opacity: 1; } }
@keyframes waitOut { from { opacity: var(--o, 1); } to { opacity: 0; } }
#waiting i {
  position: absolute;
  top: -40px;
  display: block;
  width: calc(22px * var(--s));
  height: calc(22px * var(--s));
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.08);
  animation: trickle 2.4s cubic-bezier(0.3, 0, 0.7, 1) infinite;
}
@keyframes trickle { 0% { transform: translateY(0) rotate(0deg) scaleX(1); } 50% { transform: translateY(50vh) rotate(160deg) scaleX(0.4); } 100% { transform: translateY(105vh) rotate(320deg) scaleX(1); } }

/* Crosshair cursor (cursor.js): thin and inverting, so it shows on white and on the work.
   It grows over anything clickable. Touch screens never get it. */
html.xhair body { --cursor: none; --cursor-pointer: none; }
#crosshair {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;
  will-change: transform;
}
#crosshair i {
  position: absolute;
  display: block;
  width: 23px;
  height: 23px;
  margin: -11.5px;
  background: linear-gradient(#fff, #fff) center / 100% 1.5px no-repeat, linear-gradient(#fff, #fff) center / 1.5px 100% no-repeat;
  transition: width 0.14s, height 0.14s, margin 0.14s;
}
#crosshair.hot i { width: 37px; height: 37px; margin: -18.5px; }

/* ── Lightbox: image-only projects grow out of the wall, no words ── */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  cursor: var(--cursor-pointer, zoom-out);
}
body.lightbox-open #lightbox { opacity: 1; pointer-events: auto; }
#lightbox > img,
#lightbox > .blocks {
  display: block;
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
#lightbox > .blocks { height: 88vh; width: auto; } /* as big as the screen allows */
#lightbox > .swap, #lightbox > .specimen, #lightbox > .kerncard { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18); opacity: 0; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease; }
#lightbox > .swap img:first-child { width: auto; max-width: 90vw; max-height: 88vh; }
#lightbox > .specimen { width: min(90vw, 88vh * 1000 / 1400); aspect-ratio: 1000 / 1400; }
#lightbox > .kerncard { width: min(90vw, 88vh * 1000 / 644); aspect-ratio: 1000 / 644; }
#lightbox > .shown { opacity: 1; }
#lightbox.closing > * { transform: scale(0.94); opacity: 0; }

/* ── Moving pieces ────────────────────────────────── */

/* Type flip: hand-drawn lettering as a stop-motion loop on dark film stock */
.typeflip {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: var(--cursor-pointer, pointer);
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.92  0 0 0 0 0.8  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
    #2a2017;
}
.typeflip img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 84%;
  max-height: 72%;
  pointer-events: none;
}
.panel-inner .media .typeflip img { width: auto; height: auto; } /* each frame keeps its shape */

/* Pairs: two images side by side as one piece (postcard front + back) */
.pair {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: var(--cursor-pointer, pointer);
}
.pair img, .pair video { display: block; flex: 1 1 0; min-width: 0; width: 100%; height: auto; pointer-events: none; }
.pair video { aspect-ratio: 16 / 9; object-fit: cover; } /* little clips in a row: all the same frame */
/* Poster rows (three or more side by side): every poster the same 2:3 size,
   cropped from the centre (which also trims any white margin). */
.pair.row { align-items: stretch; }
.pair.row img { aspect-ratio: var(--row-shape, 2 / 3); height: auto; object-fit: cover; }

/* Block shuffle: a poster's chunky blocks sliding along its lines */
.blocks {
  position: relative;
  overflow: hidden;
  background: #000;
  cursor: var(--cursor-pointer, pointer);
}
.blocks .bk-base { display: block; width: 100%; height: 100%; pointer-events: none; }
.blocks .bk-hole,
.blocks .bk { position: absolute; display: block; pointer-events: none; }
.blocks i.bk-hole { background: #000; }
.blocks img.bk-hole, .blocks img.bk { opacity: 1; max-width: none; max-height: none; }
.blocks .bk {
  background-repeat: no-repeat;
  transition: transform 0.55s cubic-bezier(0.75, 0, 0.2, 1);
}

/* Arabian Script: the posters swapping (stacked frames, one visible at a
   time) and the specimen pieces drawn on canvas in the typeface itself */
.swap { position: relative; cursor: var(--cursor-pointer, pointer); }
.swap img { display: block; width: 100%; height: auto; pointer-events: none; }
.swap img + img { position: absolute; inset: 0; height: 100%; }
.specimen, .kerncard { position: relative; width: 100%; background: #0b0b0b; cursor: var(--cursor-pointer, pointer); }
.specimen canvas, .kerncard canvas { display: block; width: 100%; height: 100%; pointer-events: none; }

/* Stop motion: lined-up photo frames stacked, one visible at a time. They're
   shot on white: multiply drops the white so the book sits straight on the page. */
.stopmotion { position: relative; width: 100%; overflow: hidden; cursor: var(--cursor-pointer, pointer); }
.stopmotion img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; mix-blend-mode: multiply; }

/* On the wall, frames inside these pieces are placed by their own box, not
   the wall's single-image rules (which start images invisible until loaded). */
.piece .typeflip { width: calc(100% - 44px); max-height: calc(100% - 64px); opacity: 1; }
.piece .typeflip img { opacity: 1; max-width: 84%; max-height: 72%; transition: none; }
.piece .pair { width: calc(100% - 44px); max-height: calc(100% - 64px); opacity: 1; }
.piece .blocks { height: calc(100% - 64px); max-width: calc(100% - 44px); opacity: 1; }
.piece .pair img,
.piece .swap img,
.piece .stopmotion img,
.piece .blocks .bk-base { opacity: 1; max-width: none; max-height: none; transition: none; }

/* ── Books ────────────────────────────────────────── */

/* Flip-through book mockup (book.js) */
.book { margin: 4px 0 34px; }
.book-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1.03;
  perspective: 2200px;
  cursor: var(--cursor-pointer, pointer);
}
.book-stage::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -16px;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(40, 30, 30, 0.22), transparent 70%);
  z-index: -1;
}
.book-inner {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.3, 0.1, 0.2, 1);
}
.book-inner[data-state="closed"] { transform: translateX(-50%); }
.book-inner[data-state="end"] { transform: translateX(50%); }
.leaf {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: translateZ(var(--zu));
  transition: transform 1s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.leaf.flipped { transform: rotateY(-180deg) translateZ(var(--zf)); }
.face {
  position: absolute;
  inset: 0;
  background: #f4bcc6 center / cover no-repeat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.face.back { transform: rotateY(180deg); }
/* Gutter shading so the spread reads as bound paper */
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.face.front::after { background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0) 9%, rgba(0, 0, 0, 0) 92%, rgba(0, 0, 0, 0.05)); }
.face.back::after { background: linear-gradient(to left, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0) 9%, rgba(0, 0, 0, 0) 92%, rgba(0, 0, 0, 0.05)); }
.book-hint { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 12px; }

/* Flipbook scrubber (long books) */
.book-scrub { display: flex; align-items: center; gap: 12px; margin: 22px 4px 0; }
.book-scrub input[type="range"] {
  flex: 1;
  height: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--ink);
  cursor: var(--cursor-pointer, pointer);
}
.book-scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
}
.book-scrub input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--pink); }
.book-pages { min-width: 150px; text-align: right; font: 10px var(--mono); color: var(--muted); text-transform: uppercase; }
.book-scrub + .book-hint { margin-top: 10px; }

/* 3D book
   --a: cover width ÷ height · --t: thickness ÷ width · --ry: turn (set by JS)
   --lf/--lb/--ls/--le: light on front, back, spine, page edges (set by JS) */
.book3d {
  position: relative;
  aspect-ratio: 0.86;
  container-type: size;
  perspective: 1400px;
  cursor: var(--cursor-pointer, grab);
  touch-action: none;
  --bw: 54cqw;                        /* book width */
  --bh: calc(var(--bw) / var(--a));   /* book height */
  --bt: calc(var(--bw) * var(--t));   /* book thickness */
}
.b3-obj {
  position: absolute;
  left: calc(50% - var(--bw) / 2);
  top: calc(47% - var(--bh) / 2);
  width: var(--bw);
  height: var(--bh);
  transform-style: preserve-3d;
  transform: rotateX(-9deg) rotateY(var(--ry, -25deg));
  pointer-events: none;
}
.b3 {
  position: absolute;
  inset: 0;
  background: #ddd center / 100% 100% no-repeat;
  backface-visibility: hidden;
}
.b3-front { transform: translateZ(calc(var(--bt) / 2)); filter: brightness(var(--lf, 1)); }
.b3-back { transform: rotateY(180deg) translateZ(calc(var(--bt) / 2)); filter: brightness(var(--lb, 0.8)); }
.b3-spine {
  left: calc(50% - var(--bt) / 2);
  width: var(--bt);
  transform: rotateY(-90deg) translateZ(calc(var(--bw) / 2));
  filter: brightness(var(--ls, 0.8));
}
/* Page block: fine stacked-paper lines, slightly inset from the covers */
.b3-fore {
  left: calc(50% - var(--bt) / 2);
  width: var(--bt);
  top: 0.6%;
  bottom: 0.6%;
  inset-inline: auto;
  background: repeating-linear-gradient(90deg, #f6f3ec 0 1px, #e4dfd5 1px 2px);
  transform: rotateY(90deg) translateZ(calc(var(--bw) / 2 - 0.4cqw));
  filter: brightness(var(--le, 0.9));
}
.b3-top,
.b3-bottom {
  top: calc(50% - var(--bt) / 2);
  height: var(--bt);
  bottom: auto;
  right: 0.8%;
  background: repeating-linear-gradient(0deg, #f6f3ec 0 1px, #e4dfd5 1px 2px);
}
.b3-top { transform: rotateX(90deg) translateZ(calc(var(--bh) / 2 - 0.3cqw)); filter: brightness(1.04); }
.b3-bottom { transform: rotateX(-90deg) translateZ(calc(var(--bh) / 2 - 0.3cqw)); filter: brightness(0.7); }
.b3-shadow {
  position: absolute;
  left: 20%;
  right: 20%;
  top: calc(47% + var(--bh) / 2 - 2cqw);
  height: 7cqw;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(30, 20, 40, 0.28), transparent 70%);
  filter: blur(4px);
}

/* Text for search engines and screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
