/* Direction D, round 2: a gallery, not an interface.
   White wall, generous space, small type, wall labels. Colour comes from the paintings;
   the ink loops are the only thing that moves. No pills, no fills, no shadows. */

@font-face { font-family: "Founders"; src: local("Founders Grotesk"), local("FoundersGrotesk-Regular"); font-weight: 400; }

:root {
  --bg: #FFFFFF; --ink: #161616; --ink-soft: #6E6E6E; --line: #ECECEA; --paper: #F4F3F0; --focus: #161616;
  --font-display: var(--font-body);
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, monospace;
  --font-art: var(--font-body);
  --gutter-x: 48px; --gap: 24px; --r-sm: 3px; --r-md: 4px;
  --body-size: 16px; --loop-w: 2.6; --loop-d: 0.55s; --loop-ink: var(--ink);
  --ease: cubic-bezier(.25, .6, .2, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #111111; --ink: #EDEDED; --ink-soft: #8A8A8A; --line: #262626; --paper: #1A1A1A; --focus: #EDEDED; } }
:root[data-theme="dark"] { --bg: #111111; --ink: #EDEDED; --ink-soft: #8A8A8A; --line: #262626; --paper: #1A1A1A; --focus: #EDEDED; }
@media (max-width: 760px) { :root { --gutter-x: 20px; --gap: 16px; } }

body { line-height: 1.6; }
/* Stageshow demos style themselves in a layer, which any plain rule here beats, so site type skips them */
a:where(:not(.demo-stage *)) { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .3s var(--ease); }
a:where(:not(.demo-stage *)):hover { text-decoration-color: var(--ink); }
:where(h1, h2, h3):where(:not(.demo-stage *)) { font-family: var(--font-display); font-weight: 400; }
/* Headings: the logo's face */
:root[data-head="logo"] :is(h1, h2, h3):not(.panel .intro h1, .demo-stage *, .story h2) { font-family: "Archivo", var(--font-body); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; letter-spacing: -0.035em; }
:root[data-head="logo"] h3:not(.panel .intro h1, .demo-stage *) { font-weight: 700; letter-spacing: -0.02em; }
:root[data-head="logo"] :is(.nums strong, .say strong) { font-family: "Archivo", var(--font-body); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; letter-spacing: -0.035em; }
b, strong { font-weight: 700; }

/* Header: three quiet words */
.corners { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--gap); padding-block: 22px; font-size: 14px; }
.corners a { text-decoration: none; }
.corners nav { display: flex; gap: 22px; }
.corners nav a { color: var(--ink-soft); transition: color .3s var(--ease); }
.corners nav a:hover, .corners nav a[aria-current] { color: var(--ink); }
.corners .r { text-align: right; color: var(--ink-soft); }
@media (max-width: 760px) { .corners { grid-template-columns: 1fr auto; } .corners .r { display: none; } }

.label { font-size: 16px; font-weight: 400; color: var(--ink); margin: 0 0 24px; }
section { padding-block: 120px 0; }

/* Intro: one sentence, set like an exhibition statement */
.intro { padding-block: 18vh 0; }
.intro p { font-family: var(--font-display); font-size: clamp(22px, 2.1vw, 28px); line-height: 1.35; letter-spacing: -0.01em; margin: 0; text-wrap: pretty; }
.intro .soft { color: var(--ink-soft); }

/* A painting on the wall, with a wall label beside it */
.art { margin: 0; }
.art .frame { overflow: hidden; background: var(--paper); aspect-ratio: var(--ar, 4 / 3); border-radius: var(--r-sm); }
.art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s var(--ease); }
.art.is-hung img { opacity: 1; }
.art[data-art="fit"] .frame { width: min(100%, calc(var(--fit-h, 70vh) * var(--ar))); margin-inline: auto; }
.wall-label { font-size: 12px; line-height: 1.5; color: var(--ink-soft); margin-top: 14px; display: flex; justify-content: space-between; gap: 16px; }
.wall-label b { color: var(--ink); }
.wall-label em { font-family: var(--font-art); font-size: 1.2em; font-style: italic; color: var(--ink); }
.wall-label a { text-decoration: none; color: inherit; }
.wall-label a:hover em { text-decoration: underline; text-underline-offset: 3px; }
.art[data-art="fit"] .wall-label { width: min(100%, calc(var(--fit-h, 70vh) * var(--ar))); margin-inline: auto; }
.shuffle { font: inherit; color: var(--ink-soft); background: none; border: 0; padding: 0; cursor: pointer; transition: color .3s var(--ease); }
.shuffle:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .art img { transition: none; } }

/* Work: a print and its label */
.card { display: block; text-decoration: none; }
.print { aspect-ratio: 4 / 3; background: var(--paper); border-radius: var(--r-sm); display: grid; place-items: center; }
.print [data-loop] { width: 26%; opacity: 0.9; }
.card h3 { font-size: 17px; margin: 16px 0 0; letter-spacing: -0.01em; }
.card p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.card .print { transition: background-color .5s var(--ease); }
.card:hover .print { background: color-mix(in srgb, var(--paper) 80%, var(--ink) 4%); }

/* Projects: an index, like a catalogue list */
.index { list-style: none; margin: 0; padding: 0; }
.index a { display: grid; grid-template-columns: 3ch minmax(0, 4fr) minmax(0, 6fr) auto; gap: var(--gap); padding-block: 14px; border-top: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.index li:last-child a { border-bottom: 1px solid var(--line); }
.index .n, .index .d, .index .s { color: var(--ink-soft); }
.index a:hover .d { color: var(--ink); }
@media (max-width: 760px) { .index a { grid-template-columns: 3ch 1fr auto; } .index .d { display: none; } }

/* Things I like: three small loops, catalogued */
.loops figure { margin: 0; }
.loops [data-loop] { width: 64px; }
@media (max-width: 760px) { .loops figure.blk { grid-column: span 4; } }
.loops figcaption { font-size: 12px; color: var(--ink-soft); margin-top: 10px; }

/* Case-study blocks */
.ph { background: var(--paper); border-radius: var(--r-sm); }
.text h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.text p { margin: 0; color: var(--ink-soft); }
.stat { border-top: 1px solid var(--ink); padding-top: 14px; }
.stat strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 56px; letter-spacing: -0.03em; line-height: 1; margin-top: 8px; }
.stat span { font-size: 12px; color: var(--ink-soft); }
.quote { font-family: var(--font-display); font-size: clamp(20px, 1.8vw, 24px); line-height: 1.4; margin: 0; }
.quote cite { display: block; font-family: var(--font-body); font-style: normal; font-size: 12px; color: var(--ink-soft); margin-top: 12px; }

footer { margin-top: 160px; padding-block: 28px 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
footer .big { text-transform: none; font-family: var(--font-display) !important; }
footer .big { font-family: var(--font-display); font-size: clamp(20px, 1.8vw, 24px); line-height: 1.4; color: var(--ink); margin: 0 0 48px; }
footer code { font: 11px ui-monospace, monospace; color: var(--ink); }

/* Long-form pages (case studies, projects) read like an exhibition:
   a title wall, then rooms (chapters), each with works and labels. */
.cs-title { padding-block: 16vh 0; }
.cs-title h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
.cs-title .dek { font-family: var(--font-display); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; color: var(--ink-soft); margin: 16px 0 0; }
.plaque { margin: 0; display: grid; grid-template-columns: 9ch 1fr; gap: 6px 16px; font-size: 13px; align-self: end; }
.plaque dt { color: var(--ink-soft); }
.plaque dd { margin: 0; }

.cover { padding-top: 72px; }
.chapter { padding-top: 160px; }
.chapter-no { font-size: 12px; color: var(--ink-soft); margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.chapter h2 { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.3; letter-spacing: -0.01em; margin: 0; }
.prose p { margin: 0 0 1em; max-width: 62ch; }
.prose p:last-child { margin-bottom: 0; }
.prose .lede { font-family: var(--font-display); font-size: 19px; line-height: 1.5; }
.note { border-left: 1px solid var(--line); padding-left: 20px; font-size: 13px; color: var(--ink-soft); align-self: start; }
.note b { display: block; font-weight: 400; color: var(--ink); margin-bottom: 6px; }

.works { margin-top: 48px; row-gap: 48px; }
.work-img { margin: 0; }
.work-img .ph { aspect-ratio: var(--ar, 4 / 3); }
.work-img img { width: 100%; height: auto; border-radius: var(--r-sm); background: var(--paper); }
.work-img figcaption { font-size: 12px; line-height: 1.5; color: var(--ink-soft); margin-top: 12px; max-width: 48ch; }

.principles { list-style: none; margin: 48px 0 0; padding: 0; counter-reset: p; }
.principles li { counter-increment: p; border-top: 1px solid var(--line); padding-top: 14px; }
.principles li::before { content: "0" counter(p); display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }
.principles strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1.35; }
.principles span { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

.stats { margin-top: 72px; }
.stats .stat strong { font-size: clamp(36px, 3.6vw, 52px); }
@media (max-width: 760px) { .stats .stat.blk { grid-column: span 6; } }
.stats-cap { font-size: 12px; color: var(--ink-soft); margin-top: 16px; }

.pull { padding-block: 160px 0; }
.pull p { font-family: var(--font-display); font-size: clamp(26px, 3vw, 40px); line-height: 1.2; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.pull cite { display: block; font-style: normal; font-size: 12px; color: var(--ink-soft); margin-top: 16px; }

.lessons h3 { font-size: 17px; margin: 0 0 8px; }
.lessons p { font-size: 14px; color: var(--ink-soft); margin: 0; }

.next { margin-top: 200px; border-top: 1px solid var(--line); padding-top: 20px; display: block; text-decoration: none; }
.next span { font-size: 12px; color: var(--ink-soft); }
.next strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 40px); letter-spacing: -0.02em; margin-top: 8px; transition: transform .5s var(--ease); }
.next:hover strong { transform: translateX(8px); }
@media (prefers-reduced-motion: reduce) { .next strong { transition: none; } }

/* Round 3: ASCII painting, heavy name, tinted plates */
.bigname { font-family: var(--font-display); font-weight: 800; font-size: clamp(56px, 12.6vw, 230px); line-height: 0.84; letter-spacing: -0.05em; margin: 0; white-space: nowrap; }
.ascii-hero { position: relative; margin: 0; height: min(76vh, 780px); overflow: hidden; border-radius: var(--r-sm); cursor: crosshair; }
.ascii-hero canvas, .ascii-hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ascii-hero img { object-fit: cover; opacity: 0; transition: opacity 1.8s var(--ease); }
.ascii-hero.is-revealed img { opacity: 1; }
.ascii-hero canvas { transition: opacity 1.8s var(--ease); }
.ascii-hero.is-revealed canvas { opacity: 0; }
.hero-label { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-top: 14px; }
.hero-label .shuffle { font: 400 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.02em; }
.hero-label .actions { display: flex; gap: 20px; }

/* Case-study images sit on a tinted plate, like work mounted for exhibition */
.work-img.plate { background: var(--tint, var(--paper)); padding: clamp(16px, 4.5vw, 64px); border-radius: var(--r-sm); }
.work-img.plate[style*="--s:3"], .work-img.plate[style*="--s:4"] { padding: 18px; }
.work-img.plate img { border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 40px -20px rgb(0 0 0 / 0.35); }
.work-img.plate figcaption { margin-top: 18px; color: color-mix(in srgb, var(--ink) 65%, var(--tint, var(--paper))); }

/* Round 4: the work deck. Cards stacked in 3D beside the intro, with weight in the motion. */
.deck-wrap { perspective: 1800px; }
.deck { position: relative; aspect-ratio: 4 / 3.4; transform-style: preserve-3d; transform: rotateX(calc(9deg + var(--rx, 0deg))) rotateY(calc(-16deg + var(--ry, 0deg))); transition: transform 1.1s var(--ease); outline: none; }
.deck-card { position: absolute; inset: 0 0 8% 8%; display: grid; grid-template-rows: 1fr auto; background: var(--card); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.06), 0 24px 50px -24px rgb(0 0 0 / 0.45);
  transform: translate3d(calc(var(--d) * -22px), calc(var(--d) * -18px), calc(var(--d) * -60px)) rotateZ(calc(var(--d) * -1.4deg));
  transition: transform 1s var(--ease), opacity .8s var(--ease); }
.deck-card::after { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: calc(var(--d) * 0.14); pointer-events: none; transition: opacity 1s var(--ease); }
.deck.is-fanned .deck-card { transform: translate3d(calc(var(--d) * -54px), calc(var(--d) * -30px), calc(var(--d) * -80px)) rotateZ(calc(var(--d) * -3deg)); }
.deck:not(.is-in) .deck-card { opacity: 0; transform: translate3d(0, 60px, calc(var(--d) * -60px)); }
.deck-card:nth-child(2) { transition-delay: 60ms; } .deck-card:nth-child(3) { transition-delay: 120ms; } .deck-card:nth-child(4) { transition-delay: 180ms; } .deck-card:nth-child(5) { transition-delay: 240ms; }
.deck.is-in .deck-card { transition-delay: 0ms; }
.deck-card.is-leaving { opacity: 0; transform: translate3d(12%, -10%, 140px) rotateZ(7deg); transition-duration: .38s; }
.deck-plate { background: var(--tint); display: grid; place-items: center; padding: 7%; min-height: 0; }
.deck-plate img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.18)); }
.deck-plate [data-loop] { width: 34%; color: #1C1B19; }
.deck-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; font-size: 14px; }
.deck-meta span { font: 400 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink-soft); }
.deck-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font: 400 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink-soft); }
.deck-controls button { font: inherit; color: var(--ink-soft); background: none; border: 0; padding: 6px 2px; cursor: pointer; }
.deck-controls button:hover { color: var(--ink); }
.deck-controls .btns { display: flex; gap: 16px; }
:root { --card: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --card: #1F1E1B; } }
:root[data-theme="dark"] { --card: #1F1E1B; }
@media (prefers-reduced-motion: reduce) { .deck, .deck-card { transition: none; } }
@media (max-width: 760px) { .deck { transform: rotateX(6deg) rotateY(-8deg); } .hero-split > * { grid-column: 1 / -1; } .deck-wrap { margin-top: 48px; } }

/* Round 5: a narrow reading column (Marvin Schwaibold), a fanned hand of cards (Interface Craft),
   and a row of work that runs off the right edge of the page. */
.col { width: min(100% - 2 * var(--gutter-x), 560px); margin-inline: auto; }
.col p { font-size: 18px; line-height: 1.5; margin: 0 0 1.1em; }
.col .who { margin: 0; }
.col .who + .role { color: var(--ink-soft); margin: 0 0 2.2em; }
.col a { text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }

/* Now: a small status card at the top */
.now { display: flex; align-items: center; gap: 12px; width: fit-content; margin: 28px auto 0; padding: 10px 16px 10px 10px; border-radius: 14px; background: var(--card, #fff); box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 10px 30px -12px rgb(0 0 0 / 0.18); font-size: 13px; line-height: 1.3; text-decoration: none; }
.now .ico { width: 34px; height: 34px; border-radius: 9px; background: #1B1B1B; color: #F4F3F0; display: grid; place-items: center; padding: 5px; --loop-w: 5; --loop-ink: #F4F3F0; }
.now span { display: block; color: var(--ink-soft); }

/* The hand: interests as cards, fanned like Interface Craft's library */
.hand { position: relative; height: 330px; margin: 110px auto 0; width: 100%; overflow-x: clip; overflow-y: visible; }
.hand-card { position: absolute; left: 50%; bottom: 0; width: 172px; height: 236px; margin-left: -86px; border-radius: 14px; overflow: hidden; background: var(--c); color: var(--fg);
  transform-origin: 50% 120%; transform: translateX(calc(var(--x) * var(--spread, 1))) translateY(var(--y)) rotate(var(--r));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 18px 40px -22px rgb(0 0 0 / 0.5);
  transition: transform .9s var(--ease); }
.hand:not(.is-dealt) .hand-card { transform: translateX(0) translateY(60px) rotate(0deg); }
.hand-card:hover { transform: translateX(calc(var(--x) * var(--spread, 1))) translateY(calc(var(--y) - 22px)) rotate(calc(var(--r) * 0.4)); transition-duration: .5s; }
.hand-card .pat { position: absolute; inset: 12px 12px 72px; border-radius: 6px; overflow: hidden; }
.hand-card .pat [data-loop] { position: absolute; inset: 14% 16%; --loop-ink: var(--fg); --loop-w: 3; }
.hand-card h3 { position: absolute; left: 14px; right: 14px; bottom: 14px; margin: 0; font-size: 21px; line-height: 1.05; letter-spacing: -0.01em; }
@media (max-width: 760px) { .hand { --spread: 0.36; height: 250px; margin-top: 32px; } .hand-card { width: 132px; height: 180px; margin-left: -66px; } .hand-card .pat { inset: 10px 10px 56px; } .hand-card h3 { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .hand-card { transition: none; } }

/* Latest work: starts at the column's left edge and runs off the right of the page */
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  padding-inline: max(var(--gutter-x), calc((100vw - 560px) / 2)) var(--gutter-x); scroll-padding-inline: max(var(--gutter-x), calc((100vw - 560px) / 2)); }
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail-card { flex: 0 0 min(560px, 82vw); aspect-ratio: 3 / 2; position: relative; border-radius: 16px; overflow: hidden; scroll-snap-align: start; text-decoration: none; color: #fff; background: var(--tint, #222); }
.rail-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.rail-card .inset { position: absolute; inset: 7% 10% auto; width: 80%; height: 64%; object-fit: contain; object-position: center top; }
.rail-card:hover img { transform: scale(1.03); }
.rail-card::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); }
.rail-card .cap { position: absolute; left: 22px; bottom: 20px; z-index: 1; font-size: 16px; line-height: 1.35; }
.rail-card .cap span { display: block; opacity: 0.75; }
.rail-card .arrow { position: absolute; top: 16px; right: 18px; z-index: 1; opacity: 0.8; font-size: 15px; }

/* Lists with arrows */
/* Work history (after kshv.me): company rows with a small mark, roles beneath on a diamond rail.
   Roles at the same company are joined by a dotted line. */
.jobs, .roles { list-style: none; margin: 0; padding: 0; }
.jobs > li + li { margin-top: 20px; }
.col .org { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 15px; font-weight: 500; }
.org .mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 11px; font-weight: 600; color: var(--ink-soft); flex: none; }
.org img.mark { display: block; flex: none; box-sizing: border-box; object-fit: contain; background: #fff; box-shadow: none; }
.org a { text-decoration-style: dotted; text-underline-offset: 3px; }
.org a::after { content: " ↗"; color: var(--ink-soft); }
.roles li { position: relative; padding-left: 30px; display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 16px; }
.roles li + li { padding-top: 6px; }
.roles li::before { content: ""; position: absolute; left: 6px; top: 7px; width: 7px; height: 7px; background: var(--ink-soft); rotate: 45deg; }
.roles li + li::before { top: 13px; }
.roles li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: -6px; border-left: 1px dotted var(--ink-soft); }
.roles li + li:not(:last-child)::after { top: 26px; }
.roles .role { display: block; font-size: 14px; font-weight: 500; line-height: 1.5; }
.roles .when { display: block; font-size: 13px; line-height: 21px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.col .roles p { flex-basis: 100%; font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 2px 0 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows a { display: flex; justify-content: space-between; align-items: center; padding-block: 14px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 16px; line-height: 1.35; }
.rows a span span { display: block; color: var(--ink-soft); font-size: 14px; }
.rows a::after { content: "↗"; color: var(--ink-soft); transition: transform .3s var(--ease); }
.rows a:hover::after { transform: translate(2px, -2px); color: var(--ink); }
/* the about page reads as a compact CV */
.about > p:not(.back-row) { font-size: 15px; line-height: 1.55; margin-block: 0 12px; }
.about .label { font-size: 15px; margin-bottom: 12px; }
.about .rows a { padding-block: 9px; font-size: 14px; }
.about .rows a span span { font-size: 13px; }
.home-section { padding-top: 120px; }

/* Round 6: a painting hangs behind each screenshot; the cursor leaves a brief pixel trail in it */
.rail-card .bg { z-index: 0; opacity: 0; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.rail-card.is-hung .bg { opacity: 1; }
.rail-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.rail-card .inset { z-index: 2; border-radius: 6px; filter: drop-shadow(0 14px 30px rgb(0 0 0 / 0.35)); }
.rail-card::after { z-index: 2; }
.rail-card .cap, .rail-card .arrow { z-index: 3; }
.rail-card:hover .bg { transform: scale(1.02); }
.rail-card:hover .inset { transform: none; }

/* Interest cards turn over to show something real */
.hand-card { padding: 0; perspective: 1200px; background: none; box-shadow: none; overflow: visible; transform-style: preserve-3d; }
.hand-card .face { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--c); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 18px 40px -22px rgb(0 0 0 / 0.5); transition: transform .8s var(--ease); }
.hand-card .front { border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; display: block; width: 100%; }
.hand-card .front .pat { position: absolute; inset: 12px 12px 72px; border-radius: 6px; overflow: hidden; }
.hand-card .front [data-loop] { position: absolute; inset: 14% 16%; --loop-ink: var(--fg); --loop-w: 3; }
.hand-card .back { transform: rotateY(180deg); padding: 14px; font-size: 11.5px; line-height: 1.4; display: flex; flex-direction: column; gap: 6px; }
.hand-card .back p { margin: 0; }
.hand-card .back .k { font: 400 9.5px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.75; }
.hand-card .back .big { font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.hand-card .back .sub { opacity: 0.75; }
.hand-card .back a { color: inherit; margin-top: auto; text-decoration-color: currentColor; }
.hand-card .back ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.hand-card .back ul a { margin: 0; }
.hand-card .back .photo { flex: 1; border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--fg) 45%, transparent); display: grid; place-items: center; font-size: 10.5px; opacity: 0.8; }
.hand-card.is-flipped { z-index: 10; transform: translateX(0) translateY(-14px) rotate(0deg) scale(1.42) !important; transition-duration: .8s; }
.hand-card.is-flipped .front { transform: rotateY(-180deg); }
.hand-card.is-flipped .back { transform: rotateY(0deg); }
.hand.has-flipped .hand-card:not(.is-flipped) { opacity: 0.35; }
.hand-card { transition: transform .9s var(--ease), opacity .6s var(--ease); }
@media (max-width: 760px) { .hand-card.is-flipped { transform: translateX(0) translateY(-10px) rotate(0deg) scale(1.6) !important; } }

/* Trail canvas blends with the painting */
[data-trail] canvas { mix-blend-mode: var(--trail-blend, normal); }

/* Case-study images mounted on a painting, with a quieter trail */
.mount { position: relative; padding: clamp(16px, 4.5vw, 64px); border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.work-img.blk[style*="--s:3"] .mount, .work-img.blk[style*="--s:4"] .mount { padding: 18px; }
.mount .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s var(--ease); }
.mount.is-hung .bg { opacity: 1; }
.mount canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.mount .shot { position: relative; z-index: 2; display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 18px 44px -18px rgb(0 0 0 / 0.5); }

:root { color-scheme: light dark; --art-opacity: 0.32; --art-blend: multiply; --trail-blend: multiply; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --art-opacity: 0.32; --art-blend: screen; --trail-blend: normal; } }
:root[data-theme="dark"] { --art-opacity: 0.32; --art-blend: screen; --trail-blend: normal; }

/* Theme switch, top right */
.theme { display: inline-flex; gap: 2px; justify-content: end; }
.theme button { display: grid; place-items: center; min-width: 32px; min-height: 32px; color: var(--ink-soft); background: none; border: 0; padding: 0; border-radius: 6px; cursor: pointer; transition: color .3s var(--ease), background-color .3s var(--ease); }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { color: var(--ink); background: var(--paper); }
@media (max-width: 760px) { .corners .r { display: block; } .corners { grid-template-columns: 1fr auto; } .corners nav { display: none; } }

/* Round 7: paintings sit faint over a tint; the glitch shader (or glyph trail) draws on top */
[data-trail] { background: var(--tint, var(--paper)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is([data-trail], .tile, .demo-fig .demo-stage) { background: color-mix(in srgb, var(--tint, #888) 24%, #141414); } }
:root[data-theme="dark"] :is([data-trail], .tile, .demo-fig .demo-stage) { background: color-mix(in srgb, var(--tint, #888) 24%, #141414); }
[data-trail] .bg { mix-blend-mode: var(--art-blend); }
[data-trail].is-hung .bg { opacity: var(--art-opacity); }
[data-trail].is-gl .bg { opacity: 0; }
[data-trail].is-gl canvas { mix-blend-mode: var(--trail-blend, normal); }
.rail-card { color: var(--ink); }
.rail-card::after { display: none; }
.rail-card .cap span { color: color-mix(in srgb, var(--ink) 62%, transparent); opacity: 1; }
.rail-card .arrow { color: var(--ink-soft); }

/* Accessibility pass: card backs at full contrast, comfortable tap targets */
.hand-card .back .k, .hand-card .back .sub, .hand-card .back .photo { opacity: 1; }
.hand-card .back ul { gap: 2px; }
.hand-card .back ul a { display: block; padding-block: 4px; min-height: 24px; }
.hand-card .back .photo { border-color: currentColor; }
.col h1.who { font: inherit; font-size: 18px; line-height: 1.5; }

/* Round 8: real objects float on the page, drawn by one shared 3D layer (objects.js) */
.objects { position: relative; height: 300px; margin-top: 64px; }
.objects-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
.objects-canvas.is-contained { position: absolute; width: 100%; height: 100%; z-index: 1; }
html.is-grabbable, html.is-grabbable * { cursor: grab; }
html.is-grabbing, html.is-grabbing * { cursor: grabbing !important; user-select: none; }
.object-tip { position: fixed; z-index: 35; pointer-events: none; transform: translate(-50%, -100%) translateY(4px); opacity: 0;
  background: var(--ink); color: var(--bg); border-radius: 8px; padding: 7px 11px; font-size: 13px; line-height: 1.35; white-space: nowrap;
  transition: opacity .25s var(--ease), transform .25s var(--ease); }
.object-tip.is-on { opacity: 1; transform: translate(-50%, -100%); }
.object-tip b { font-weight: 500; display: block; }
.object-tip span { opacity: 0.7; }
@media (max-width: 760px) { .objects { height: 280px; margin-top: 24px; } }
@media (prefers-reduced-motion: reduce) { .object-tip { transition: none; } }

/* Round 9: tiny personal things by the name on inner pages */
.corners > a:first-child { display: inline-flex; align-items: center; gap: 10px; }
.minis { position: relative; display: inline-block; height: 40px; flex: none; }
.minis canvas { display: block; width: 100%; height: 40px; }
.mini-slot { position: absolute; top: 0; height: 40px; }
.object-tip.is-below { transform: translate(-50%, 0) translateY(-4px); }
.object-tip.is-below.is-on { transform: translate(-50%, 0); }
.corners > a:first-child { white-space: nowrap; }
@media (max-width: 760px) {
  .corners > a:first-child { gap: 6px; }
  .minis { transform: scale(0.75); transform-origin: left center; margin-right: -32px; }
}

/* Lightbox (lightbox.js): a native dialog, image zooms out of its spot on the page */
img[data-lightbox] { cursor: zoom-in; }
img[data-lightbox]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.lightbox { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden; }
.lightbox::backdrop { background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); }
.lightbox[open]::backdrop { animation: lb-fade .3s var(--ease); }
.lightbox.is-closing::backdrop { opacity: 0; transition: opacity .3s var(--ease); }
.lightbox figure { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; gap: 14px; padding: 56px 48px 28px; box-sizing: border-box; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 8px; transform-origin: 0 0; box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.45); cursor: default; }
.lightbox figcaption { font-size: 13px; color: var(--ink-soft); max-width: 60ch; text-align: center; transition: opacity .2s; }
.lightbox.is-closing figcaption, .lightbox.is-closing .lb-close, .lightbox.is-closing .lb-count { opacity: 0; }
.lb-close { position: absolute; top: 16px; right: 20px; font: inherit; font-size: 13px; color: var(--ink-soft); background: var(--paper); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.lb-close:hover { color: var(--ink); }
.lb-count { position: absolute; top: 22px; left: 24px; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
html.lb-open { overflow: hidden; }
@keyframes lb-fade { from { opacity: 0; } }
@media (max-width: 760px) { .lightbox figure { padding: 52px 12px 20px; } }
@media (prefers-reduced-motion: reduce) { .lightbox[open]::backdrop { animation: none; } }

/* Logo (logo.js): a cycling mark next to the name, bold and wide with tight tracking */
.corners > a.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.lg-mark { position: relative; width: 22px; height: 22px; flex: none; color: var(--ink); }
.lg-m { position: absolute; inset: 0; opacity: 0; transform: scale(.4) rotate(-90deg); transition: opacity .3s var(--ease), transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.lg-m svg { display: block; width: 100%; height: 100%; }
.lg-m.is-on { opacity: 1; transform: none; }
.lg-m.is-off { opacity: 0; transform: scale(.4) rotate(90deg); transition-timing-function: var(--ease); }
.lg-word { font-family: "Archivo", var(--font-body); font-weight: 800; font-stretch: 125%; font-variation-settings: "wdth" 125; font-size: 17px; letter-spacing: -0.035em; word-spacing: 0.05em; line-height: 1; text-transform: uppercase; white-space: nowrap; font-kerning: normal; }
@media (prefers-reduced-motion: reduce) { .lg-m { transition: none; } }

/* Round 10: quieter header. Logo left, nav right; on phones the nav sits on its own line under the logo.
   The theme switch lives in the footer row (.theme-row). */
.corners { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; row-gap: 10px; column-gap: var(--gap); }
.corners .r { display: none !important; }
.corners nav { display: flex !important; gap: 22px; }
@media (max-width: 760px) { .corners nav { flex-basis: 100%; gap: 20px; font-size: 15px; } }
.theme-row { display: flex; align-items: center; gap: 8px; padding-block: 0 40px; font-size: 13px; color: var(--ink-soft); }
.col h1.who { margin: 0 0 1.1em; }
body > footer:has(+ .theme-row) { padding-bottom: 16px; }

/* About: a quiet back link above the column */
.col .back-row { font-size: 14px; margin: 0 0 32px; } .col .back-row a { color: var(--ink-soft); text-decoration: none; } .col .back-row a:hover { color: var(--ink); }
