:root {
  --bg: #fff;
  --ink: #111;
  --muted: #8a8a85;
  --line: rgba(0, 0, 0, 0.1);
  --chip: rgba(255, 255, 255, 0.85);
  --blue: #1a1aff;
  --panel-w: min(560px, 100vw);
}

* { 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);
}

/* ── Wall of stained glass ─────────────────────────── */

#wall {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  cursor: var(--cursor, grab);
  touch-action: none;
  user-select: none;
  transition: filter 0.6s ease, transform 1.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease;
}
#wall.dragging { cursor: var(--cursor, grabbing); }
body.intro #wall { opacity: 0; transform: scale(1.12); filter: blur(18px); }
body.panel-open #wall,
body.works-open #wall,
body.lightbox-open #wall { filter: blur(10px); }

.tile {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  will-change: transform;
}
.piece {
  position: absolute;
  inset: 0;
  padding: 28px 0 0 28px; /* gutter: pieces hang from the top-left of their cell */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.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:not(.dragging) .piece img:hover,
#wall:not(.dragging) .piece video:hover { transform: scale(1.03); }
/* Tiny numbered caption under each piece */
.piece figcaption {
  margin-top: 8px;
  font: 9px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0.75;
  pointer-events: none;
}
.piece figcaption span { margin-right: 8px; color: var(--muted); }

/* Works-list hover: fade other projects */
#wall.focusing .tile { transition: opacity 0.3s ease; opacity: 0.1; }
#wall.focusing .tile.match { 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 ──────────────────────────────────────── */

.corner {
  position: fixed;
  z-index: 20;
  padding: 5px 8px;
  background: var(--chip);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  line-height: 1;
  transition: background 0.2s, color 0.2s, opacity 0.8s ease 0.4s;
}
.corner:hover, .corner.active { background: var(--ink); color: var(--bg); }
.tl { top: 12px; left: 12px; }
.tr { top: 12px; right: 12px; }
.bl { bottom: 12px; left: 12px; }
.br { bottom: 12px; right: 12px; }
body.intro .corner { opacity: 0; pointer-events: none; transition-delay: 0s; }

/* ── Works list ───────────────────────────────────── */

.works-list {
  position: fixed;
  z-index: 19;
  left: 12px;
  bottom: 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.works-list[hidden] { display: none; }
.works-list button {
  padding: 5px 8px;
  background: var(--chip);
  line-height: 1;
  text-align: left;
}
.works-list button span { color: var(--muted); margin-left: 8px; }
.works-list button:hover { background: var(--ink); color: var(--bg); }
.works-list button:hover span { color: #bbb; }

/* ── 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);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: -1px 0 0 var(--line);
}
body.panel-open #panel { transform: none; }

.panel-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 44px;
}
.panel-close:hover { color: var(--blue); }

.panel-inner { padding: 14px 20px 60px; }
.panel-inner h2 {
  font-family: "Archivo Black", sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 16px 0 6px;
}
.panel-inner .type { color: var(--muted); margin: 0 0 22px; }
.panel-inner .desc {
  font-size: 15px;
  line-height: 1.45;
  max-width: 46ch;
  white-space: pre-line;
  margin: 0 0 32px;
}
.panel-inner .media { display: flex; flex-direction: column; gap: 10px; }
.panel-inner .media img,
.panel-inner .media video { width: 100%; display: block; }
.panel-inner a { color: inherit; }
.panel-inner a:hover { color: var(--blue); }
.panel-inner .links { display: flex; gap: 18px; font-size: 15px; }
.panel-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.panel-nav button:hover { color: var(--blue); }

/* ── 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; }
@keyframes bob { 50% { transform: translateY(-4px); } }

@media (max-width: 600px) {
  :root { --panel-w: 100vw; }
}

/* ── Whimsy ───────────────────────────────────────── */

a { cursor: var(--cursor-pointer, pointer); }


/* Scanned sparkles + wand cursor (canvas layers) */
#sparkles,
#wand {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#sparkles { z-index: 28; }
#wand { z-index: 60; }

/* 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 > .shown { opacity: 1; }
#lightbox.closing > * { transform: scale(0.94); opacity: 0; }

/* 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; }


/* ── Type system: bold grotesk × swash script × tiny mono ── */
:root {
  --sans: "Helvetica Neue", Helvetica, "Inter Tight", Arial, sans-serif;
  --script: "Pinyon Script", cursive;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --pink: #ff4f9a;
}

/* Corners: bold caps that invert over whatever drifts beneath */
.corner {
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #fff;
  mix-blend-mode: difference;
  font: 800 14px/1 var(--sans);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.tl { top: 16px; left: 18px; }
.tr { top: 16px; right: 18px; }
.bl { bottom: 16px; left: 18px; }
.br { bottom: 16px; right: 18px; }
.corner:hover,
.corner.active { background: none; color: #fff; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Works list: big bold index */
.works-list { left: 18px; bottom: 44px; gap: 0; }
.works-list button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 8px 3px 0;
  background: var(--bg);
  font: 800 clamp(22px, 3vw, 34px)/1 var(--sans);
  letter-spacing: -0.045em;
}
.works-list button em { font: 10px var(--mono); font-style: normal; letter-spacing: 0; color: var(--muted); align-self: center; }
.works-list button span { font: 20px/1 var(--script); letter-spacing: 0; color: var(--pink); margin-left: 4px; }
.works-list button:hover { background: var(--bg); color: var(--pink); }
.works-list button:hover span { color: var(--ink); }

/* Panel */
.panel-inner .p-num { margin: 18px 0 6px; font: 11px var(--mono); color: var(--muted); }
.panel-inner h2 {
  margin: 0;
  font: 800 clamp(40px, 6vw, 64px)/0.9 var(--sans);
  letter-spacing: -0.05em;
}
.panel-inner .type { margin: 2px 0 22px 2px; font: 30px/1.1 var(--script); color: var(--pink); }
.panel-inner .desc { font: 16px/1.45 var(--sans); letter-spacing: -0.005em; }
.panel-nav { font: 800 14px var(--sans); letter-spacing: -0.02em; text-transform: uppercase; }

/* Hovering a piece: its title, huge */
#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; }
#hoverScript { z-index: 16; padding-top: 0.9em; font-size: clamp(56px, 12.5vw, 210px); }
#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;
}
#hoverScript i {
  display: inline-block;
  font: clamp(34px, 5.5vw, 92px)/1 var(--script);
  font-style: normal;
  color: var(--pink);
  transform: rotate(-5deg);
  text-shadow: 0 1px 0 #fff, 0 0 18px rgba(255, 255, 255, 0.9);
}
#hoverTitle .ht-num { margin-bottom: 10px; font: 12px var(--mono); color: #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; }

/* Spinning record-label badge */
#badge {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px; /* has the corner to itself now Play is gone */
  width: 104px;
  transition: opacity 0.8s ease 0.4s, transform 0.3s ease;
}
#badge svg { display: block; width: 100%; overflow: visible; }
#badge text { font: 800 8.4px var(--sans); letter-spacing: 0.06em; fill: var(--ink); }
#badge .spin { transform-origin: 60px 60px; animation: spin 16s linear infinite; }
#badge .badge-star { fill: url(#badgeFoil); stroke: rgba(60, 64, 78, 0.45); stroke-width: 0.8; transform-origin: 60px 60px; transition: transform 0.4s ease; }
#badge:hover { transform: scale(1.06); }
#badge:hover .spin { animation-duration: 4s; }
#badge:hover .badge-star { transform: rotate(36deg) scale(1.1); }
body.intro #badge { opacity: 0; pointer-events: none; transition-delay: 0s; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { #badge { width: 78px; bottom: 14px; } }

/* 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;
}
/* On the wall it sizes like any other piece */
.piece .typeflip {
  width: calc(100% - 44px);
  max-height: calc(100% - 64px);
  opacity: 1;
}
/* In the panel it leads the project */
.panel-inner .media .typeflip { margin-bottom: 0; }

/* 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 { display: block; flex: 1 1 0; min-width: 0; width: 100%; height: auto; pointer-events: none; }
.piece .pair { width: calc(100% - 44px); max-height: calc(100% - 64px); opacity: 1; }
.panel-inner .media .pair { gap: 10px; }

/* Frames inside a type flip or pair are positioned by their own box, not the
   wall's single-image rules (which start images invisible until loaded). */
.piece .typeflip img {
  opacity: 1;
  max-width: 84%;
  max-height: 72%;
  transition: none;
}
.piece .pair img {
  opacity: 1;
  max-width: none;
  max-height: none;
  transition: none;
}

/* 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);
}
/* On the wall it sizes like any other piece */
.piece .blocks {
  height: calc(100% - 64px);
  max-width: calc(100% - 44px);
  opacity: 1;
}
.piece .blocks .bk-base { opacity: 1; max-width: none; max-height: none; transition: none; }
.piece .blocks img.bk-hole, .piece .blocks img.bk { opacity: 1; max-width: none; max-height: none; }
/* In the lightbox, as big as the screen allows */
#lightbox > .blocks { height: 88vh; width: auto; }

/* ?try-hover / ?try-stars: switchers for comparing confetti hover styles and star exits */
#hoverPicker, #starPicker {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 94vw;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ddd;
  font: 12px var(--mono);
}
#hoverPicker button, #starPicker button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 99px; }
#hoverPicker button.on, #starPicker button.on { background: #111; color: #fff; border-color: #111; }
#hoverPicker span, #starPicker span { flex-basis: 100%; text-align: center; color: #777; }
body:not(.intro) #hoverPicker, body:not(.intro) #starPicker { display: none; }

/* ── Tillmans hang ───────────────────────────────────
   Prints of very different sizes on a warm gallery wall: no frames, a hairline
   shadow where the paper lifts off the wall,. */
#wall { background: #fff; }
#wall .tile { position: absolute; top: 0; left: 0; margin: 0; }
#wall .tile .piece {
  position: absolute;
  inset: 0;
  padding: 0;
  display: block;
}
#wall .tile .piece > img,
#wall .tile .piece > video,
#wall .tile .piece > .typeflip,
#wall .tile .piece > .pair,
#wall .tile .piece > .blocks {
  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); }
/* 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. */
#wall .tile .piece figcaption {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  margin: 0;
  max-width: calc(100% + 10px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.75;
}
#wall .tile:hover .piece figcaption {
  z-index: 2;
  max-width: none;
  overflow: visible;
  padding-right: 4px;
  background: #fff;
  opacity: 1;
}
#wall:not(.dragging) .tile .piece > img:hover,
#wall:not(.dragging) .tile .piece > video:hover { transform: none; }
#wall .tile:hover { z-index: 5; }

/* ── 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,
.b3-top,
.b3-bottom { background: repeating-linear-gradient(90deg, #f6f3ec 0 1px, #e4dfd5 1px 2px); }
.b3-fore {
  left: calc(50% - var(--bt) / 2);
  width: var(--bt);
  top: 0.6%;
  bottom: 0.6%;
  inset-inline: auto;
  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);
}
.panel-inner .media .book3d { margin-bottom: 8px; }
#wall .tile .piece > .book3d { box-shadow: none; }

/* 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; }

/* 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; }

/* 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; }
.piece .swap img { opacity: 1; max-width: none; max-height: none; transition: none; }
#wall .tile .piece > .swap,
#wall .tile .piece > .specimen,
#wall .tile .piece > .kerncard {
  display: block;
  width: 100%;
  height: 100%;
  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; }
.panel-inner .media .specimen, .panel-inner .media .kerncard { margin-bottom: 10px; }

/* 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; }
@media (prefers-reduced-motion: reduce) { .rn-dot { animation: none; } }

/* Badge styles (pick with ?try-badge; BADGE in gallery.js sets the default) */
#badge.badge-record { width: 92px; }
#badge.badge-record .spin { animation-duration: 5s; }
#badge.badge-record:hover .spin { animation-duration: 1.8s; }
#badge.badge-record .label-text { font: 800 4.6px var(--sans); letter-spacing: 0.05em; fill: #fff; }
#badge.badge-stamp { width: 150px; transform: rotate(-9deg); }
#badge.badge-stamp:hover { transform: rotate(-6deg) scale(1.05); }
#badge.badge-stamp .stamp-name { font: 800 17px var(--sans); letter-spacing: -0.01em; fill: var(--pink); }
#badge.badge-stamp .stamp-sub { font: 8px var(--mono); letter-spacing: 0.08em; fill: var(--pink); }
#badge.badge-ticker { width: 230px; padding: 7px 0; background: var(--ink); border-radius: 99px; overflow: hidden; }
#badge.badge-ticker .tape { display: block; white-space: nowrap; }
#badge.badge-ticker .tape span { display: inline-block; padding-left: 100%; font: 11px var(--mono); letter-spacing: 0.06em; color: #fff; animation: tape 16s linear infinite; }
#badge.badge-ticker:hover .tape span { color: var(--pink); }
@keyframes tape { to { transform: translateX(-100%); } }
#badge.badge-signature { width: auto; text-align: right; }
#badge.badge-signature .sig { display: block; font: 38px/1 var(--script); color: var(--ink); transition: color 0.3s; }
#badge.badge-signature .sig-sub { display: block; margin-top: 2px; font: 10px var(--mono); color: var(--muted); }
#badge.badge-signature:hover .sig { color: var(--pink); }
#badge.badge-star { width: 70px; }
#badge.badge-star .badge-star.big { animation: spin 22s linear infinite; }
#badge.badge-star .star-name { position: absolute; right: 100%; top: 50%; margin-right: 8px; transform: translateY(-50%); white-space: nowrap; font: 11px var(--mono); opacity: 0; transition: opacity 0.3s; }
#badge.badge-star:hover .star-name { opacity: 1; }
#badgePicker { position: fixed; z-index: 70; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 94vw; padding: 8px 10px; background: rgba(255, 255, 255, 0.92); border: 1px solid #ddd; font: 12px var(--mono); }
#badgePicker button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 99px; }
#badgePicker button.on { background: #111; color: #fff; border-color: #111; }
#badgePicker span { flex-basis: 100%; text-align: center; color: #777; }
body.intro #badgePicker { display: none; }

/* Phones: let the browser pinch-zoom the page (one finger still drags the
   wall), and once zoomed in, let one finger pan around the zoomed page. */
#wall { touch-action: pinch-zoom; }
body.zoomed #wall { touch-action: auto; }

/* Phones: an open panel or lightbox covers the whole screen, so hide the wall
   behind it instead of blurring it — a full-screen blur over ~80 pieces is
   enough to run Safari on iPhone out of memory. */
@media (max-width: 560px) {
  body.panel-open #wall,
  body.lightbox-open #wall { visibility: hidden; filter: none; transition: none; }
}
/* ?try-confetti: switcher for what the confetti name is made of */
#confettiPicker { position: fixed; z-index: 70; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 94vw; padding: 8px 10px; background: rgba(255, 255, 255, 0.92); border: 1px solid #ddd; font: 12px var(--mono); }
#confettiPicker button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 99px; }
#confettiPicker button.on { background: #111; color: #fff; border-color: #111; }
#confettiPicker span { flex-basis: 100%; text-align: center; color: #777; }
body:not(.intro) #confettiPicker { display: none; }
/* ?try-motion: switcher for the home screen's idle motion */
#motionPicker { position: fixed; z-index: 70; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 94vw; padding: 8px 10px; background: rgba(255, 255, 255, 0.92); border: 1px solid #ddd; font: 12px var(--mono); }
#motionPicker button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 99px; }
#motionPicker button.on { background: #111; color: #fff; border-color: #111; }
#motionPicker span { flex-basis: 100%; text-align: center; color: #777; }
body:not(.intro) #motionPicker { display: none; }
/* 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; }


/* Small-print credit line at the end of a project panel (e.g. school projects) */
.panel-inner .credit { margin: 6px 0 22px; font: 10.5px var(--mono); letter-spacing: 0.03em; color: var(--muted); text-transform: uppercase; }
/* ?try-script: switcher for the script font */
#scriptPicker { position: fixed; z-index: 70; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 94vw; padding: 8px 10px; background: rgba(255, 255, 255, 0.95); border: 1px solid #ddd; font: 12px var(--mono); }
#scriptPicker button { padding: 2px 10px; border: 1px solid #ccc; border-radius: 99px; }
#scriptPicker button.on { background: #111; color: #fff; border-color: #111; }
#scriptPicker span { flex-basis: 100%; text-align: center; color: #777; }
/* ?try-wand: switcher for the wand cursor (shown on every screen) */
#wandPicker { position: fixed; z-index: 70; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 94vw; padding: 8px 10px; background: rgba(255, 255, 255, 0.95); border: 1px solid #ddd; font: 12px var(--mono); }
#wandPicker button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 99px; }
#wandPicker button.on { background: #111; color: #fff; border-color: #111; }
#wandPicker span { flex-basis: 100%; text-align: center; color: #777; }

/* Stop motion: lined-up photo frames stacked, one visible at a time */
.stopmotion { position: relative; width: 100%; overflow: hidden; cursor: var(--cursor-pointer, pointer); }
/* The frames are shot on white: multiply drops the white so the book sits straight on the page, like the other cutouts. */
.stopmotion img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; mix-blend-mode: multiply; }
.piece .stopmotion img { opacity: 1; max-width: none; max-height: none; transition: none; }
#wall .tile .piece > .stopmotion { display: block; width: 100%; height: 100%; }
.panel-inner .media .stopmotion { margin-bottom: 10px; }

/* Works list on phones: a clean white page of its own (the wall is hidden
   behind it), each project type tucked under its title. */
.works-list button b { font-weight: inherit; }
body.works-open #badge { opacity: 0; pointer-events: none; transition-delay: 0s; }
@media (max-width: 560px) {
  body.works-open #wall { visibility: hidden; filter: none; transition: none; }
  .works-list {
    inset: 0;
    padding: 76px 18px 68px;
    background: var(--bg);
    justify-content: flex-end;
    gap: 16px;
    overflow-y: auto;
  }
  .works-list button {
    display: grid;
    grid-template-columns: 30px 1fr;
    width: 100%;
    padding: 0;
    font-size: 31px;
    line-height: 0.95;
  }
  .works-list button em { grid-row: 1; align-self: start; margin-top: 0.55em; }
  .works-list button b { grid-column: 2; text-wrap: balance; }
  .works-list button span { grid-column: 2; margin: 3px 0 0; font-size: 22px; line-height: 1.1; text-wrap: balance; }
}
/* Even rags everywhere: balanced headings and types, no lonely last words. */
.panel-inner h2, .panel-inner .type, .rn-now { text-wrap: balance; }
.panel-inner .desc { text-wrap: pretty; }

/* While the wall gets ready (WAIT in gallery.js; ?try-wait to compare) */
#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; display: block; border-radius: 50%; 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); }
.wait-signature { display: flex; align-items: center; justify-content: center; }
.wait-signature span { font: clamp(56px, 11vw, 150px)/1 var(--script); color: var(--pink); opacity: 0; animation: sigIn 1.2s ease 0.15s forwards; }
@keyframes sigIn { to { opacity: 1; } }
.wait-disc i { left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; animation: discSpin 1.1s linear infinite; }
.wait-disc i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #fff; }
@keyframes discSpin { to { transform: rotate(360deg); } }
.wait-trickle i { top: -40px; width: calc(22px * var(--s)); height: calc(22px * var(--s)); 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); } }
#waitPicker { position: fixed; z-index: 70; left: 50%; top: 54px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 94vw; padding: 8px 10px; background: rgba(255, 255, 255, 0.95); border: 1px solid #ddd; font: 12px var(--mono); }
#waitPicker button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 99px; }
#waitPicker button.on { background: #111; color: #fff; border-color: #111; }
#waitPicker span { flex-basis: 100%; text-align: center; color: #777; }
body:not(.intro) #waitPicker { display: none; }

/* Info: "wanna make something together?" contact box */
.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: 0 0 14px; font: 34px/1.1 var(--script); color: var(--pink); }
.hello label { display: block; margin-top: 12px; font: 10.5px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.hello input, .hello textarea { display: block; width: 100%; margin-top: 4px; padding: 6px 0; border: 0; border-bottom: 1px solid #cfcfca; border-radius: 0; background: none; font: 16px/1.4 var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0; resize: vertical; }
.hello input:focus, .hello textarea:focus { outline: none; border-bottom-color: var(--pink); }
.hello button { margin-top: 18px; padding: 9px 16px; border-radius: 99px; background: var(--ink); color: #fff; font: 800 14px var(--sans); letter-spacing: -0.01em; }
.hello button:hover { background: var(--pink); }
.hello button:disabled { opacity: 0.5; }
.hello-note { margin: 10px 0 0; min-height: 1em; font: 11px var(--mono); color: var(--muted); }
.hello.sent .hello-script { margin-bottom: 4px; }

/* ── Bags page (bags.js) ── */
.bl2 { bottom: 16px; left: 122px; }
body.intro .bl2 { opacity: 0; pointer-events: none; }
body.bags-open #wall { visibility: hidden; }
body.bags-open #badge, body.bags-open #worksList { opacity: 0; pointer-events: none; }
#bags { position: fixed; inset: 0; z-index: 32; background: var(--bg); overflow: hidden auto; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s 0.35s; }
body.bags-open #bags { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.bags-close { position: fixed; z-index: 3; top: 14px; right: 18px; font: 300 30px/1 var(--sans); }
.bags-thread { position: absolute; left: 0; top: 0; width: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.bags-thread path { fill: none; stroke: var(--pink); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 7 6; animation: sew 2.4s linear infinite; }
@keyframes sew { to { stroke-dashoffset: -26; } }
/* photos around the edge, like a contents page (bags.js places them) */
.bags-frame { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); grid-template-rows: repeat(4, 1fr); height: 100vh; padding: 54px 22px 22px; box-sizing: border-box; gap: 14px; }
.bag { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0; transition: transform 0.25s ease; }
.bag img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 1px 1.5px rgba(40, 30, 20, 0.16), 0 6px 14px rgba(40, 30, 20, 0.08); }
.bag:hover { transform: scale(1.04); }
.bags-middle { position: fixed; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 60vw); text-align: center; }
.bags-middle h2 { margin: 0; font: 800 clamp(48px, 7vw, 96px)/0.9 var(--sans); letter-spacing: -0.05em; }
.bags-line { margin: 10px auto 26px; max-width: 34ch; font: 12px/1.5 var(--mono); color: var(--muted); text-wrap: balance; }
.bags-cta { display: inline-flex; flex-direction: column; align-items: center; padding: 18px 36px 16px; border-radius: 999px; background: var(--ink); color: #fff; font: 800 clamp(18px, 2vw, 24px)/1 var(--sans); letter-spacing: -0.03em; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); transition: background 0.2s, transform 0.2s; }
.bags-cta span { margin-top: 4px; font: clamp(30px, 3.4vw, 42px)/1 var(--script); letter-spacing: 0; color: var(--pink); transition: color 0.2s; }
.bags-cta:hover { background: var(--pink); transform: rotate(-2deg) scale(1.03); }
.bags-cta:hover span { color: #fff; }
.bags-zoom, .bags-form { position: fixed; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.9); }
.bags-zoom[hidden], .bags-form[hidden] { display: none; }
.bags-zoom img { max-width: 90vw; max-height: 88vh; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18); }
.bags-form .hello { width: min(460px, 90vw); margin: 0; background: var(--bg); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12); }
/* phones: button first, then the photos two across */
@media (max-width: 1100px) {
  .bags-middle { position: relative; left: auto; top: auto; transform: none; width: auto; padding: 70px 18px 26px; }
  .bags-frame { grid-template-columns: 1fr 1fr; grid-template-rows: none; height: auto; padding: 0 18px 40px; gap: 18px; }
  .bags-frame .bag { grid-area: auto !important; }
  #bags { display: flex; flex-direction: column; }
  #bags .bags-middle { order: -1; }
}
/* Commission button: the pink leather patch (tag, stitched and pill kept as alternatives) */
.bags-cta[data-style] { transform: none; }
.bags-cta[data-style="patch"] { position: relative; padding: 22px 40px 20px; border-radius: 6px; background: #e0187f; color: #fff; box-shadow: 0 2px 3px rgba(80, 0, 40, 0.25), 0 10px 24px rgba(80, 0, 40, 0.18); transform: rotate(-2deg); }
.bags-cta[data-style="patch"]::before { content: ""; position: absolute; inset: 7px; border: 1.5px dashed rgba(255, 255, 255, 0.85); border-radius: 3px; pointer-events: none; }
.bags-cta[data-style="patch"] span { color: #fff; }
.bags-cta[data-style="patch"]:hover { background: #c40f6c; transform: rotate(0deg) scale(1.04); }
.bags-cta[data-style="tag"] { position: relative; padding: 20px 34px 18px 54px; border-radius: 4px 4px 4px 4px; background: #f6f1e7; color: var(--ink); clip-path: polygon(26px 0, 100% 0, 100% 100%, 26px 100%, 0 50%); box-shadow: none; filter: drop-shadow(0 6px 10px rgba(40, 30, 20, 0.18)); transform: rotate(3deg); }
.bags-cta[data-style="tag"]::before { content: ""; position: absolute; left: 20px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px #d8cfbf; }
.bags-cta[data-style="tag"] span { color: var(--pink); }
.bags-cta[data-style="tag"]:hover { background: #fff; transform: rotate(-1deg) scale(1.04); }
.bags-cta[data-style="tag"]:hover span { color: var(--pink); }
.bags-cta[data-style="stitched"] { padding: 22px 40px 20px; border-radius: 22px; background: none; color: var(--ink); box-shadow: none; outline: 2px dashed var(--pink); outline-offset: -6px; }
.bags-cta[data-style="stitched"]:hover { background: #fff0f6; transform: scale(1.03); }
.bags-cta[data-style="stitched"]:hover span { color: var(--pink); }
/* Bags page on black */
#bags { background: #0b0b0b; color: #f4f2ee; }
#bags .bags-close { color: #f4f2ee; }
#bags .bags-middle h2 { color: #f4f2ee; }
#bags .bags-line { color: #9a9894; }
#bags .bag img { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 10px 24px rgba(0, 0, 0, 0.45); }
#bags .bags-zoom, #bags .bags-form { background: rgba(11, 11, 11, 0.92); }
#bags .bags-form .hello { color: var(--ink); }
#bags .bags-cta[data-style="patch"] { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 12px 28px rgba(224, 24, 127, 0.25); }

/* ── Bags page, editorial (after the design ideology magazine) ── */
#bags { --stitch: #e8408c; --stitch-blue: #2e5fb3; --fluoro: #f59ac8; --seal: #e8408c; } /* secondary color: the pink of the pink tote */
.bags-thread path { stroke: var(--stitch); stroke-dasharray: 6 6; stroke-width: 1.6; }
.bags-run { position: fixed; z-index: 2; top: 50%; margin: 0; font: 700 10px "Courier Prime", monospace; letter-spacing: 0.18em; text-transform: uppercase; color: #8d8a84; white-space: nowrap; }
.bags-run-l { left: 10px; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; left: 18px; }
.bags-run-r { right: 18px; transform: translate(50%, -50%) rotate(90deg); transform-origin: center; right: 10px; }
.bag { flex-direction: column; gap: 6px; }
.bag img { min-height: 0; flex: 1 1 auto; }
.bag-cap { flex: none; font: 11px/1.2 "Courier Prime", monospace; color: #bdb9b2; text-align: left; align-self: flex-start; }
.bag-cap i { display: inline-block; min-width: 20px; margin-right: 4px; padding: 0 3px; border: 1px dashed var(--stitch); border-radius: 50%; font-style: normal; font-weight: 700; color: var(--stitch); text-align: center; }
#bags .bags-middle { width: min(520px, 46vw); text-align: center; }
.bags-blurb { margin: 0 auto 10px; max-width: 40ch; font: 600 12px/1.35 Archivo, var(--sans); color: #d8d5cf; text-align: left; }
.bags-oval { position: relative; width: min(400px, 40vw); margin: 0 auto; aspect-ratio: 400 / 240; }
.bags-oval svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oval-fill { fill: #f6f1e7; }
.oval-inner { fill: none; stroke: var(--stitch-blue); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.5; }
.oval-ring { font: 700 15px "Courier Prime", monospace; fill: var(--stitch-blue); letter-spacing: 0.08em; }
.bags-oval h2 { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; }
.bags-oval h2 span { font: clamp(46px, 5.4vw, 74px)/0.9 "Jacquard 24", serif; color: var(--stitch-blue); letter-spacing: 0; }
.bags-oval h2 em { font: clamp(26px, 2.8vw, 38px)/1 "Jacquard 24", serif; font-style: normal; color: var(--stitch); }
.bags-note { position: relative; margin: 14px auto 18px; max-width: 46ch; padding-left: 30px; font: 12px/1.5 "Courier Prime", monospace; color: #d8d5cf; text-align: left; }
.bags-note i { position: absolute; left: 0; top: -1px; width: 20px; height: 20px; border: 1px dashed var(--stitch); border-radius: 50%; font: 700 11px/19px "Courier Prime", monospace; font-style: normal; color: var(--stitch); text-align: center; }
.bags-quote { margin: 18px 0 0; font: 14px/1.4 "Courier Prime", monospace; letter-spacing: 0.14em; text-transform: uppercase; color: #f4f2ee; }
.bags-quote span { display: block; }
.bags-quote span + span { padding-left: 4em; }
.bags-quote b { font: 22px/1 "Pinyon Script", cursive; letter-spacing: 0; text-transform: none; color: var(--stitch); }
.bags-seal { position: absolute; right: -6px; top: 42%; display: grid; place-items: center; width: 54px; height: 54px; border: 2px solid var(--seal); outline: 1px solid var(--seal); outline-offset: 3px; font: 26px/1 "Jacquard 24", serif; color: var(--seal); transform: rotate(9deg); }
@media (max-width: 1100px) {
  .bags-run { display: none; }
  #bags .bags-middle { width: auto; }
  .bags-oval { width: min(340px, 86vw); }
  .bags-seal { right: 18px; top: 330px; width: 44px; height: 44px; font-size: 20px; }
  .bag-cap { font-size: 10px; }
}
@media (min-width: 701px) and (max-width: 1100px) { .bags-frame { grid-template-columns: repeat(3, 1fr); } }
/* keep the middle inside the frame on desktop */
@media (min-width: 1101px) {
  .bags-oval { width: min(320px, 26vw); }
  .bags-note { margin: 10px auto 14px; font-size: 11.5px; }
  .bags-quote { display: none; }
  .bags-seal { width: 46px; height: 46px; font-size: 22px; }
}
@media (min-width: 1101px) { #bags .bags-middle { transform: translate(-50%, calc(-50% + 14px)); } }
/* The commission patch in silver leather (like the silver tote) */
#bags .bags-cta[data-style="patch"] {
  background: linear-gradient(135deg, #f4f5f7 0%, #b9bdc6 22%, #eef0f3 42%, #8e939d 64%, #dfe2e7 82%, #a6aab3 100%);
  color: #17181b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55), 0 12px 28px rgba(220, 225, 235, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
#bags .bags-cta[data-style="patch"]::before { border-color: rgba(23, 24, 27, 0.55); }
#bags .bags-cta[data-style="patch"] span { color: #e8354f; }
#bags .bags-cta[data-style="patch"]:hover { background: linear-gradient(135deg, #ffffff 0%, #c9cdd5 22%, #f7f8fa 42%, #a0a5ae 64%, #eceef2 82%, #b6bac2 100%); }
/* Silver leather with the words debossed into it */
#bags .bags-cta[data-style="patch"] {
  background:
    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='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.52 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 -0.35'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23c)'/%3E%3C/svg%3E"),
    linear-gradient(125deg, #e9ebee 0%, #a7abb3 20%, #dfe2e6 38%, #868b94 58%, #cfd2d8 76%, #9a9ea6 100%);
  background-blend-mode: overlay, soft-light, normal;
  color: #8a8e96;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 -1px 0 rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), 0 14px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 3px rgba(0, 0, 0, 0.25);
}
#bags .bags-cta[data-style="patch"] span { color: #8a8e96; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 -1px 0 rgba(0, 0, 0, 0.5); }
#bags .bags-cta[data-style="patch"]::before { border: 1.5px dashed rgba(40, 42, 48, 0.5); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
#bags .bags-cta[data-style="patch"]:hover { background-blend-mode: overlay, soft-light, normal; filter: brightness(1.08); }
#bags .bags-cta[data-style="patch"], #bags .bags-cta[data-style="patch"] span { color: #63676f; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85), 0 -1px 1px rgba(0, 0, 0, 0.55); }
/* Bags: enlarged photo with arrows */
#bags .bags-zoom { gap: clamp(8px, 3vw, 40px); }
.bags-zoom figure { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
#bags .bags-zoom img { max-width: 76vw; max-height: 80vh; }
.bags-zoom figcaption { font: 12px "Courier Prime", monospace; color: #bdb9b2; }
.bags-zoom figcaption i { display: inline-block; min-width: 22px; margin-right: 6px; padding: 0 3px; border: 1px dashed var(--stitch); border-radius: 50%; font-style: normal; font-weight: 700; color: var(--stitch); text-align: center; }
.zoom-arrow { flex: none; width: 48px; height: 48px; border: 1.5px dashed var(--stitch); border-radius: 50%; color: #f4f2ee; font: 22px/1 "Courier Prime", monospace; transition: background 0.2s, transform 0.2s; }
.zoom-arrow:hover { background: var(--stitch); transform: scale(1.08); }
@media (max-width: 700px) {
  #bags .bags-zoom { flex-wrap: wrap; align-content: center; }
  .bags-zoom figure { order: -1; flex-basis: 100%; align-items: center; }
  #bags .bags-zoom img { max-width: 92vw; max-height: 70vh; }
}
/* The thread as real pink embroidery floss, lying on the page */
#bags .bags-thread path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: none; animation: none; }
#bags .bags-thread .t-shadow { stroke: rgba(0, 0, 0, 0.55); stroke-width: 7; transform: translate(1.5px, 3px); filter: blur(2px); }
#bags .bags-thread .t-base { stroke: #ff2d78; stroke-width: 5.5; filter: url(#floss); }
/* the twist of the plies: short dark diagonals along the strand */
#bags .bags-thread .t-twist { stroke: #b80c4f; stroke-width: 5.5; stroke-dasharray: 1.3 3.6; opacity: 0.7; filter: url(#floss); }
#bags .bags-thread .t-shine { stroke: #ff9cc2; stroke-width: 1.4; stroke-dasharray: 2.4 2.5; stroke-dashoffset: 1.2; opacity: 0.75; transform: translate(-0.8px, -0.8px); }
#bags .bags-thread .t-base, #bags .bags-thread .t-twist { stroke-width: 7; }
#bags .bags-thread .t-shadow { stroke-width: 9; }
#bags .bags-thread .t-twist { stroke-dasharray: 1.6 4.2; }
/* the stretches of thread that come up over the photos, and their punctures */
#bags .bags-thread-over { z-index: 1; }
#bags .bags-thread-over .t-mask { fill: none; stroke: #fff; stroke-width: 26; stroke-linecap: butt; filter: none; }
#bags .bags-thread-over .holes circle { fill: #2a0a16; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
#bags .bags-middle { z-index: 2; }
/* Realistic floss: drawn as twisted plies (bags.js); just the shadow and dimples here */
#bags .bags-thread .t-shadow { stroke: rgba(0, 0, 0, 0.5); stroke-width: 7; transform: translate(1px, 2.5px); filter: blur(1.6px); }
#bags .bags-thread .plies { filter: drop-shadow(0 0.6px 0.4px rgba(90, 0, 35, 0.55)); }
#bags .bags-thread .fibre { fill: none; stroke: #ff6fa3; stroke-width: 0.6; opacity: 0.8; }
#bags .bags-thread-over .holes ellipse { fill: rgba(0, 0, 0, 0.45); stroke: none; filter: blur(1.4px); }
.panel-inner .credit a { text-decoration: underline; text-underline-offset: 2px; }
.panel-inner .credit a:hover { color: var(--pink); }
/* moving ring text: letters ride the middle of the band and glide without pixel snapping */
#bags .oval-ring { dominant-baseline: central; text-rendering: geometricPrecision; will-change: transform; }
#bags .oval-ring text { text-anchor: middle; dominant-baseline: central; }
/* Bags: hovering a photo scrunches it up from the top (like takeagander.com/work),
   and the caption slides up into the space it leaves */
#bags .bag img { transform-origin: 50% 0; transition: transform 0.3s ease; }
#bags .bag-cap { transition: transform 0.3s ease; }
#bags .bag:hover { transform: none; }
@media (hover: hover) {
  #bags .bag:hover img { transform: scaleY(0.83); }
  #bags .bag:hover .bag-cap { transform: translateY(calc(var(--lift, 0px) * -1)); }
}

/* ── View switch (Gallery / Grid), after basedesign.com ── */
#viewSwitch { position: fixed; z-index: 21; top: 12px; left: 50%; transform: translateX(-50%); display: flex; transition: opacity 0.8s ease 0.4s; }
#viewSwitch button { padding: 6px 11px 5px; border: 1px solid var(--ink); background: var(--bg); font: 500 12px/1 var(--sans); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); transition: background 0.15s, color 0.15s; }
#viewSwitch button + button { margin-left: -1px; }
#viewSwitch button.on { background: var(--ink); color: var(--bg); }
#viewSwitch button:not(.on):hover { background: #f1f1ef; }
body.intro #viewSwitch, body.bags-open #viewSwitch { opacity: 0; pointer-events: none; transition-delay: 0s; }

/* ── Grid view ── */
#gridView { position: fixed; inset: 0; z-index: 18; overflow-y: auto; background: var(--bg); padding: 64px 18px 70px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 14px; align-content: start; }
#gridView[hidden] { display: none; }
body.grid-open #wall { visibility: hidden; }
body.grid-open #badge { opacity: 0; pointer-events: none; }
.g-tile { display: flex; flex-direction: column; gap: 7px; padding: 0; text-align: left; }
.g-media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #f3f3f1; }
.g-media img, .g-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 0; transition: transform 0.3s ease; }
.g-cap { min-height: 1em; font: 11px/1.2 var(--mono); color: var(--ink); text-transform: uppercase; letter-spacing: 0.02em; transition: transform 0.3s ease; }
.g-cap em { margin-right: 8px; font-style: normal; color: var(--muted); }
@media (hover: hover) {
  .g-tile:hover .g-media img, .g-tile:hover .g-media video { transform: scaleY(0.88); }
}
@media (max-width: 560px) {
  #gridView { grid-template-columns: 1fr 1fr; gap: 20px 10px; padding: 60px 14px 70px; }
  #viewSwitch { top: 13px; }
  #viewSwitch button { padding: 5px 8px 4px; font-size: 11px; }
}
/* show each piece whole in its tile (nothing cropped) */
.g-media { background: #f4f4f2; }
.g-media img, .g-media video { object-fit: contain; padding: 8%; box-sizing: border-box; }
/* Grid view, organised by project */
#gridView { display: block; padding: 64px 18px 80px; }
.g-project + .g-project { margin-top: 46px; }
.g-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; width: 100%; margin: 0 0 12px; padding: 0 0 8px; border-bottom: 1px solid var(--ink); text-align: left; }
.g-head em { font: 11px var(--mono); font-style: normal; color: var(--muted); }
.g-head b { font: 800 clamp(22px, 2.6vw, 30px)/1 var(--sans); letter-spacing: -0.045em; }
.g-head span { font: 20px/1 var(--script); color: var(--pink); }
.g-head:hover b { color: var(--pink); }
.g-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 560px) {
  #gridView { padding: 60px 14px 80px; }
  .g-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g-project + .g-project { margin-top: 36px; }
}
/* Grid view: one cover per project */
.g-covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px 18px; }
.g-covers .g-media { aspect-ratio: 4 / 5; background: #f4f4f2; }
.g-covers .g-media img, .g-covers .g-media video { object-fit: cover; padding: 0; }
.g-covers .g-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 4px; text-transform: none; letter-spacing: 0; }
.g-covers .g-cap em { font: 11px var(--mono); color: var(--muted); margin: 0; }
.g-covers .g-cap b { font: 800 20px/1.05 var(--sans); letter-spacing: -0.04em; }
.g-covers .g-cap span { font: 18px/1 var(--script); color: var(--pink); }
.g-covers .g-tile:hover .g-cap b { color: var(--pink); }
@media (max-width: 900px) { .g-covers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .g-covers { grid-template-columns: 1fr; gap: 32px; } }
/* a clean strip behind the top labels while the grid scrolls under them */
/* Grid covers: square cards, no backdrop — each piece shown whole and clean */
.g-covers .g-media { aspect-ratio: 1 / 1; background: none; }
.g-covers .g-media img, .g-covers .g-media video { object-fit: contain; padding: 0; }
.g-covers .g-tile:hover .g-media img { transform: scaleY(0.9); }
/* Grid captions: number + title on one line, the type in script always on its own line below */
.g-covers .g-cap span { flex-basis: 100%; margin-top: 2px; }

/* Bags page, all screen sizes: the seal, note and button on top,
   then the photos in a grid underneath (like the phone layout) */
#bags { display: flex; flex-direction: column; }
#bags .bags-middle { position: relative; order: -1; left: auto; top: auto; transform: none !important; width: auto; max-width: 620px; margin: 0 auto; padding: 84px 18px 40px; }
#bags .bags-oval { width: min(400px, 80vw); }
#bags .bags-note { font-size: 12px; margin: 16px auto 20px; }
#bags .bags-quote { display: block; }
#bags .bags-seal { right: -40px; top: 150px; }
#bags .bags-frame { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; height: auto; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 48px 70px; gap: 30px 22px; box-sizing: border-box; }
#bags .bags-frame .bag { grid-area: auto !important; }
@media (min-width: 1101px) { #bags .bags-run { display: block; } }
@media (max-width: 900px) { #bags .bags-frame { grid-template-columns: 1fr 1fr; padding: 0 24px 50px; gap: 20px; } }
@media (max-width: 700px) {
  #bags .bags-frame { padding: 0 18px 40px; gap: 18px; }
  #bags .bags-middle { padding-top: 70px; }
  #bags .bags-seal { right: 18px; top: 330px; }
}
/* a smaller commission patch */
#bags .bags-cta[data-style="patch"] { padding: 14px 28px 13px; font-size: clamp(15px, 1.6vw, 19px); }
#bags .bags-cta[data-style="patch"] span { font-size: clamp(24px, 2.6vw, 32px); }
#bags .bags-cta[data-style="patch"]::before { inset: 5px; }

/* ── iPhone breathing room ── */
@media (max-width: 560px) {
  /* corner type a step smaller */
  .corner { font-size: 12.5px; }
  .tl, .tr { top: 15px; }
  #viewSwitch { top: 11px; }
  #viewSwitch button { padding: 4px 7px 3px; font-size: 10px; }
  /* the signature, smaller */
  #badge.badge-signature .sig { font-size: 27px; }
  #badge.badge-signature .sig-sub { font-size: 9px; }
  /* the works list starts below the header and scrolls under a clean strip */
  .works-list { justify-content: flex-start; padding: 70px 18px 80px; gap: 14px; }
  .works-list button:first-child { margin-top: auto; }
  .works-list button { font-size: 26px; }
  .works-list button span { font-size: 19px; }
  body.works-open::before { content: ""; position: fixed; z-index: 19; left: 0; right: 0; top: 0; height: 48px; background: var(--bg); }
  .works-list { z-index: 18; }
  /* bottom corners sit on a clean strip too, so the list never runs under them */
  body.works-open::after { content: ""; position: fixed; z-index: 19; left: 0; right: 0; bottom: 0; height: 46px; background: var(--bg); }
}
/* Info: email / Instagram / LinkedIn as icons */
.panel-inner .links { align-items: center; gap: 16px; }
.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); }
/* Info: disciplines under the title line */
.panel-inner .disciplines { display: flex; flex-wrap: wrap; gap: 4px 0; margin: -10px 0 24px 2px; 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); }
.panel-inner .disciplines { margin: 4px 0 22px 0; }

/* phones: fade the wall in without the big blur (heavy for iPhone Safari) */
@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; } }

/* The Graphics list button is retired: Gallery/Grid at the top covers it.
   (Its code stays in gallery.js; un-hide #worksBtn to bring it back.) */
#worksBtn { display: none; }
/* Top left: name, with the role underneath */
#homeBtn { text-align: left; }
#homeBtn .tl-sub { display: block; margin-top: 4px; font: 400 10.5px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 560px) { #homeBtn .tl-sub { font-size: 9px; margin-top: 3px; } }
/* The signature badge in the bottom right is retired */
#badge { display: none !important; }
/* phones: the Gallery/Grid switch moves to the (now empty) bottom-left corner */
@media (max-width: 560px) {
  #viewSwitch { top: auto; bottom: 14px; left: 18px; transform: none; }
}
/* Home (your name) in Grid view: the grid steps back for the confetti, then
   returns when it bursts — the same way the gallery wall does */
#gridView { transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
body.intro #gridView { opacity: 0; transform: scale(1.04); pointer-events: none; transition-duration: 0.3s; }
body.intro.grid-open::before, body.intro.grid-open::after { opacity: 0; }

/* placeholder for wall pieces that are built once on screen */
#wall .tile .piece > .piece-slot { width: 100%; height: 100%; }

/* Grid view: an open project (or the lightbox) blurs the grid behind it,
   the same as the gallery wall */
#gridView { transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease; }
body.panel-open #gridView,
body.lightbox-open #gridView { filter: blur(10px); }
@media (max-width: 560px) {
  body.panel-open #gridView,
  body.lightbox-open #gridView { visibility: hidden; filter: none; transition: none; }
}

/* Corner type on black label-tape strips: each line its own slightly
   crooked, rough-cut piece (wabi-sabi), like highlighted text on a poster */
.corner { mix-blend-mode: normal; color: var(--ink); text-decoration: none !important; }
.corner:hover, .corner.active { color: var(--ink); }
.corner .hl, #viewSwitch .hl {
  display: inline-block;
  padding: 4px 7px 3px 6px;
  background: #0b0b0b;
  color: #fff;
  transform: rotate(var(--r, 0deg)) translate(var(--dx, 0), var(--dy, 0));
  transition: background 0.15s, color 0.15s;
}
.hl-1 { }
.hl-2 { --dx: 6px; }
.hl-3 { }
.hl-4 { }
.hl-5 { --dy: 3px; }
#homeBtn .tl-sub { margin-top: 2px; }
#homeBtn .tl-sub .hl { padding: 3px 6px 2px; }
.corner:hover .hl, .corner.active .hl { background: var(--pink); }
/* Gallery / Grid: two strips; the one you're on is bright, the other dimmed */
#viewSwitch { gap: 3px; }
#viewSwitch button, #viewSwitch button.on, #viewSwitch button:not(.on):hover { padding: 0; border: 0; background: none; margin: 0; }
#viewSwitch button .hl { color: #8d8d8d; }
#viewSwitch button.on .hl { color: #fff; }
#viewSwitch button:not(.on):hover .hl { color: #fff; background: var(--pink); }


/* Hover script: long subtitles (Jigitz) wrap on phones — keep every line centred */
#hoverScript i { max-width: 90vw; text-align: center; text-wrap: balance; }
