@font-face { font-family: "Pixel"; src: url("assets/Pixelated-Elegance.ttf") format("truetype"); font-display: swap; }
/* the opening lines: Funnel Display (variable weight) */
@font-face { font-family: "Funnel Sans"; src: url("assets/fonts/FunnelSans.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Funnel Display"; src: url("assets/fonts/FunnelDisplay.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }

/* Soft is the paper; Tech is the underside */
:root {
  --paper: #f4f4f4;
  --ink: #141414;
  --muted: #6e6963;
  --line: #141414;
  --orange: #ec7a33;
  --under: #060606;     /* what shows through the folds on Soft */
  --gutter: clamp(16px, 4vw, 56px);
  --px: "Pixel", ui-monospace, monospace;
  --display: "Funnel Display", "Host Grotesk", system-ui, sans-serif;
  --grotesk: "Host Grotesk", system-ui, sans-serif;
  --funnel-sans: "Funnel Sans", "Host Grotesk", system-ui, sans-serif;
  /* one font per kind of text (try them out at ?fonts) */
  --f-intro: var(--px);
  --f-headings: var(--px);
  --f-subheads: var(--display);
  --f-lead: var(--grotesk);
  --f-body: var(--grotesk);
  --f-question: var(--display);
  --f-search: var(--display);
  --f-doors: var(--display);
  --f-projects: var(--display);
  --f-labels: var(--display);
  --f-contact: var(--display);
  --f-buttons: var(--display);
  --f-explain: var(--display);
}
body.tech {
  --paper: #060606;
  --ink: #e8e5e0;
  --muted: #8f8a83;
  --line: #3d3a37;
  --under: #f4f4f4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--f-body);
  overflow-x: hidden;
}
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3, .px { font-family: var(--f-headings); font-weight: 400; letter-spacing: .02em; }
h3 { font-family: var(--f-subheads); letter-spacing: 0; }

/* ---------- ASCII field ---------- */
/* below the content but above the page colour; main stays unlayered so the name can multiply into the paper */
.ascii { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .8s; }
.tech .ascii { opacity: 1; }

/* ---------- liquid words: a canvas paints the text; the real text stays underneath, unseen ---------- */
:where(.lq) { position: relative; }
.lq-on { color: transparent !important; }
.lq-canvas { position: absolute; max-width: none; pointer-events: none; }

/* ---------- intro: a pixel ball types three lines, then lands on them ---------- */
body.intro { overflow: hidden; }
.intro-screen {
  will-change: transform; /* its own layer from the start, so sliding it away does not make one mid-flight */
  position: fixed; inset: 0; z-index: 70; display: grid; align-content: center;
  padding: 0 var(--gutter); background: var(--paper);
}
.intro-screen.melt { background: transparent; pointer-events: none; }
.intro-screen.melt .lq-canvas { opacity: 0; transition: opacity .7s 1s; }
.intro-screen.gone { display: none; }
/* one thought on stage at a time: both lines share the same place */
.i-lines { display: grid; }
.i-line { grid-area: 1 / 1; align-self: center; margin: 0; color: var(--orange); font-family: var(--px); font-size: clamp(22px, 4.2vw, 60px); line-height: 1.6; }
/* the new opening is set in Funnel Display; the classic one keeps the pixel font */
.hello .i-line { font-family: var(--f-intro); }
/* the camera follows the thrown ball up: the opening falls away below */
.intro-screen.lift { transform: translateY(100%); transition: transform 1.1s cubic-bezier(.6,0,.3,1); pointer-events: none; }
.lift .skip, .pan .skip { opacity: 0; }
/* or, following the rolling ball, it slides away to the left */
.intro-screen.pan { transform: translateX(-100%); transition: transform 1s cubic-bezier(.6,0,.3,1); pointer-events: none; }
/* the ball: one orange drop with the name's grain */
.ball { position: fixed; left: 0; top: 0; z-index: 72; pointer-events: none; overflow: visible; transform-origin: 50% 100%; }
.ball path, .ball ellipse { fill: var(--orange); filter: url(#ball-grain); }
.skip { position: absolute; z-index: 1; right: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; transition: opacity .35s; }
.melt .skip { opacity: 0; }

/* ---------- the one button: a pixel mouth that talks ---------- */
.talk {
  position: fixed; top: 12px; right: var(--gutter); z-index: 30; padding: 4px 10px 4px 8px; background: var(--paper);
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--f-buttons); font-size: 15px; color: var(--ink);
}
.mouth { width: 36px; height: 24px; fill: var(--orange); }
.talk:hover span, .talk:focus-visible span { color: var(--orange); }
.talk, .name, .finder { transition: opacity .9s; }
body.intro .talk, body.intro .name, body.intro .page-corner, body.intro .finder { opacity: 0; }
body.intro .question { visibility: hidden; }

/* ---------- finder ---------- */
.finder { margin: 0 0 clamp(18px, 2.4vw, 28px); }
.finder input {
  width: min(560px, 100%); padding: 6px 0; border: 0; border-bottom: 1.5px dashed var(--muted);
  background: none; color: var(--ink); font: clamp(15px, 1.5vw, 19px) var(--f-search); outline: none;
}
.finder input:focus { border-bottom-color: var(--orange); }
.finder input::placeholder { color: var(--muted); }
/* results: projects on the left, the practices, explorations and filters they open on the right */
.results:not(:empty) { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 8px clamp(20px, 4vw, 56px); margin-top: 18px; max-width: 1100px; }
.results .r-note { grid-column: 1 / -1; margin: 0; font: 14px var(--f-search); color: var(--muted); }
.results .r-note button, .results .r-note a { background: none; border: 0; padding: 0; color: var(--orange); font: inherit; cursor: pointer; text-decoration: none; }
.r-group h3 { margin: 6px 0 8px; font-size: 12px; color: var(--muted); }
.r-group ul { list-style: none; margin: 0; padding: 0; }
.r-project { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; padding: 7px 0; text-decoration: none; }
.r-project .thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 3px; }
.thumb.none { display: block; width: 56px; height: 42px; border-radius: 3px; background: radial-gradient(circle at 50% 60%, var(--orange) 0 6px, transparent 7px); outline: 1px dashed var(--muted); outline-offset: -1px; }
.r-text { display: grid; gap: 2px; }
.r-title { font-family: var(--f-projects); font-size: 15px; }
.r-sub { font-size: 14px; line-height: 1.35; color: var(--muted); }
.r-why { font: 11px/1.5 var(--f-search); color: var(--orange); }
.r-cat { color: var(--muted); margin-left: 8px; }
.r-project:hover .r-title, .r-project:focus-visible .r-title, .r-cat-btn:hover .r-title { color: var(--orange); }
.r-cat-btn { display: grid; gap: 2px; width: 100%; padding: 6px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.results mark { background: none; color: inherit; text-decoration: underline 1.5px var(--orange); text-underline-offset: 3px; }
.r-values { margin: 0; }
.results a:focus-visible, .results button:focus-visible, .archive button:focus-visible, .archive summary:focus-visible, .here a:focus-visible { outline: 1.5px solid var(--orange); outline-offset: 3px; border-radius: 2px; }
@media (max-width: 760px) { .results:not(:empty) { grid-template-columns: 1fr; } }
/* a chip: a value to filter by */
.chip {
  display: inline-block; margin: 0 6px 6px 0; padding: 2px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: none; font: 11px/1.6 var(--f-labels); cursor: pointer;
}
.chip:hover { border-color: var(--orange); color: var(--orange); }
.chip.on { background: var(--orange); border-color: var(--orange); color: var(--paper); }
.door { transition: opacity .5s, transform .6s cubic-bezier(.2,.8,.2,1), filter .5s; }
.finding .door:not(.lit) { opacity: .18 !important; filter: grayscale(1); }
.door.lit .door-label { color: var(--orange); }
.door.lit .figs { transform: translateY(-8px) scale(1.04); }

/* ---------- landing ---------- */
.landing {
  min-height: 100svh; padding: 88px var(--gutter) 48px;
  display: flex; flex-direction: column; justify-content: center;
}
/* the name and the figure are artwork on white: on paper they multiply in, on Tech they glow on black */
.name, .figure { width: 100%; height: auto; mix-blend-mode: multiply; }
.name { cursor: crosshair; }
.tech .name, .tech .figure { mix-blend-mode: normal; }
/* the question travels here from the intro and stays as the connector to the doors */
.question {
  width: fit-content; max-width: 100%; min-height: 1.6em; margin: clamp(20px, 3vw, 36px) 0 clamp(18px, 2.4vw, 28px);
  font-family: var(--f-question); font-size: clamp(14px, 1.4vw, 18px); color: var(--orange); transform-origin: 0 0;
}
.doors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); }
.door {
  display: block; text-decoration: none; opacity: 0; transform: translateY(18px);
  transition: opacity .7s, transform .6s cubic-bezier(.2,.8,.2,1);
}
.ready .door { opacity: 1; transform: none; }
.ready .door:nth-child(2) { transition-delay: .1s; } .ready .door:nth-child(3) { transition-delay: .2s; }
.ready .door:nth-child(4) { transition-delay: .3s; } .ready .door:nth-child(5) { transition-delay: .4s; }
/* hairline figures: drawn in the page's ink with orange for the lit parts; one per side */
.fig.soft { --hairline-plate: #f4f4f4; --hairline-hi: #ec7a33; --hairline-edge: #141414; --hairline-mid: #4a4744; --hairline-lo: #b9b4ad; --hairline-stroke: 1; }
.fig.tech { --hairline-plate: #060606; --hairline-hi: #ec7a33; --hairline-edge: #e8e5e0; --hairline-mid: #9d9891; --hairline-lo: #3a3836; --hairline-stroke: 1; }
.tech .fig.soft, body:not(.tech) .fig.tech { display: none; }
/* no frames: the figures float in the page */
.figs { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.figs .fig { width: 100%; }
.door:hover .figs, .door:focus-visible .figs { transform: translateY(-6px) scale(1.03); }
.door span { display: block; margin-top: 10px; font-family: var(--f-doors); font-size: clamp(13px, 1.2vw, 16px); }
.door:hover span { color: var(--orange); }

/* ---------- topics ---------- */
.topics { padding: 0 var(--gutter); }
/* the words on the left, the animations stacked down the right */
.topic {
  position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 4vw, 64px); align-items: start;
  padding: clamp(56px, 8vw, 120px) 0;
}
.topic .anim { position: sticky; top: 90px; width: 100%; order: 2; }
/* the drawings sit above the ball when it goes behind something in them (the ball steps down to z-index 1) */
.topic .anim .fig.soft { z-index: 2; }

/* ---------- scrolling: the page has weight ---------- */
/* --sv is the scroll speed; doors lag behind it by different amounts, like things on a string */
.ready .door { transform: translateY(calc(var(--sv, 0) * var(--lag, 0) * 1px)); }
.door:nth-child(1) { --lag: -.6; } .door:nth-child(2) { --lag: -1.1; } .door:nth-child(3) { --lag: -1.6; }
.door:nth-child(4) { --lag: -2.1; } .door:nth-child(5) { --lag: -2.6; }
.landing .name { transform: scaleY(calc(1 + var(--sv, 0) * .003)); transform-origin: 50% 100%; }
/* a topic arrives: its figure slides in from the side, its text steps up */
.topic .anim, .topic .side { transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .9s; }
.topic:not(.in) .anim { transform: translateX(40px) rotate(2deg); opacity: 0; }
.topic:not(.in) .side { transform: translateY(40px); opacity: 0; }
.topic .anim .fig { transform: skewY(calc(var(--sv, 0) * -.12deg)); transition: transform .2s; }
.side[hidden] { display: none; }
.side .num { font-family: var(--f-labels); font-size: 14px; color: var(--orange); }
.side h2 { font-size: clamp(28px, 3.6vw, 52px); line-height: 1.05; margin: 8px 0 6px; }
.side .yr { font-family: var(--f-labels); font-size: 14px; color: var(--muted); }
.side .lead { font-family: var(--f-lead); font-size: clamp(19px, 1.6vw, 23px); line-height: 1.4; margin: 18px 0; max-width: 40ch; }
.tech .side .lead { color: var(--orange); }
.side .body { max-width: 60ch; }
.side .body a { color: var(--orange); }
.side .body ul { padding-left: 18px; }
.todo { border: 1px dashed var(--muted); border-radius: 6px; padding: 8px 12px; color: var(--muted); font-size: 14px; }
.media { columns: 2; column-gap: 12px; margin: 24px 0; }
.media figure { margin: 0 0 12px; break-inside: avoid; }
.media img, .media video { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--line); }
.media figcaption { margin-top: 5px; font-family: var(--f-labels); font-size: 11px; color: var(--muted); }
.related { font-family: var(--f-labels); font-size: 13px; color: var(--muted); margin-top: 28px; }
.related a { color: var(--ink); text-decoration: none; margin-left: 10px; }
.related a:hover { color: var(--orange); }

/* each topic names its projects, each a way into the index */
.here { font-family: var(--f-labels); font-size: 13px; color: var(--muted); margin-top: 18px; }
.here a { color: var(--ink); text-decoration: none; margin-right: 12px; white-space: nowrap; }
.here a::before { content: "→ "; color: var(--orange); }
.here a:hover { color: var(--orange); }

/* ---------- the index: every project, expandable, filterable ---------- */
.archive { padding: clamp(56px, 8vw, 120px) var(--gutter); }
.archive > h2 { font-size: clamp(28px, 3.6vw, 52px); line-height: 1.05; margin: 0 0 10px; }
.archive-sub { margin: 0 0 32px; max-width: 52ch; color: var(--muted); }
.worlds { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 64px); margin-bottom: 18px; }
.world h3 { margin: 0; font-size: 18px; }
.world-sub { margin: 2px 0 12px; font: 12px var(--f-labels); color: var(--muted); }
.world ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cat {
  display: grid; grid-template-columns: 1fr auto; gap: 0 12px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer;
}
.cat-name { font-family: var(--f-projects); font-size: 15px; }
.cat-n { font: 12px var(--f-labels); color: var(--muted); }
.cat-line { grid-column: 1 / -1; font-size: 14px; line-height: 1.4; color: var(--muted); }
.cat:hover .cat-name, .cat.on .cat-name { color: var(--orange); }
.cat.on .cat-name::before { content: "● "; }
.more { margin: 8px 0 14px; }
.more > summary { cursor: pointer; font: 13px var(--f-labels); color: var(--muted); }
.more-filters { padding-top: 12px; }
.facet { margin-bottom: 8px; }
.facet-name { display: inline-block; min-width: 9ch; margin-right: 6px; font: 11px var(--f-labels); color: var(--muted); }
.active-filters { min-height: 28px; font: 12px var(--f-labels); color: var(--muted); }
.active-filters > span { margin-right: 10px; }
.active-filters .clear { border: 0; background: none; color: var(--orange); cursor: pointer; font: inherit; }
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.project { border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.project > details > summary {
  display: grid; grid-template-columns: 72px minmax(0, 3fr) minmax(0, 4fr); grid-template-rows: auto auto; gap: 2px 18px; align-items: start;
  padding: 14px 0; cursor: pointer; list-style: none;
}
.project > details > summary::-webkit-details-marker { display: none; }
.project .thumb { grid-row: 1 / 3; width: 72px; height: 54px; object-fit: cover; border-radius: 3px; }
.project .thumb.none { width: 72px; height: 54px; }
.p-title { font-family: var(--f-projects); font-size: clamp(17px, 1.6vw, 22px); }
.p-sub { grid-column: 2; font-size: 15px; color: var(--muted); }
.p-meta { grid-column: 3; grid-row: 1 / 3; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: flex-end; font: 11px/1.8 var(--f-labels); color: var(--muted); }
summary:hover .p-title, details[open] .p-title { color: var(--orange); }
.p-open { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 clamp(20px, 4vw, 56px); padding: 6px 0 36px 90px; }
.p-open .media { grid-column: 1 / -1; margin-top: 8px; }
.p-text { max-width: 60ch; }
.p-text a { color: var(--orange); }
.p-links { padding-left: 18px; }
.facts { margin: 0; }
.facts > div { margin-bottom: 12px; }
.facts dt { font: 11px var(--f-labels); color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; }
.p-related { grid-column: 1 / -1; font: 13px var(--f-labels); color: var(--muted); }
.p-related a { color: var(--ink); text-decoration: none; margin-left: 12px; }
.p-related a:hover { color: var(--orange); }
@media (max-width: 760px) {
  .worlds { grid-template-columns: 1fr; }
  .project > details > summary { grid-template-columns: 56px minmax(0, 1fr); }
  .project .thumb, .project .thumb.none { width: 56px; height: 42px; }
  .p-meta { grid-column: 2; grid-row: auto; justify-content: flex-start; }
  .p-open { grid-template-columns: 1fr; padding-left: 0; }
}

/* the fold on every block: the twin waits under it */
.fold {
  position: absolute; top: 0; right: 0; display: flex; align-items: flex-start; gap: 10px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.fold .label { margin-top: 14px; font-family: var(--f-labels); font-size: 12px; color: var(--muted); transition: color .3s; }
.fold .tri {
  width: 44px; height: 44px; transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(225deg, var(--paper) 0 50%, var(--under) 50% 100%);
  filter: drop-shadow(-2px 2px 2px rgba(0,0,0,.18));
}
.fold:hover .tri, .fold:focus-visible .tri { width: 64px; height: 64px; }
.fold:hover .label { color: var(--orange); }

/* ---------- contact ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 4vw, 64px); align-items: center;
  padding: clamp(80px, 12vw, 160px) var(--gutter);
}
.figure-cut { position: relative; width: 100%; max-width: 540px; justify-self: end; }
.figure-cut .figure { position: relative; }
.figure-paper { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contact-line { font-family: var(--f-contact); font-size: clamp(34px, 5.2vw, 76px); line-height: 1.04; letter-spacing: -.02em; max-width: 16ch; margin: 0 0 28px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 11px 20px; border: 0; border-radius: 7px; cursor: pointer;
  font-family: var(--f-buttons); font-size: 15px; text-decoration: none;
  background: var(--orange); color: #141414; transition: transform .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.foot { padding: 24px var(--gutter) 40px; font-family: var(--f-labels); font-size: 12px; color: var(--muted); }

/* ---------- the one-time explanation ---------- */
.explain {
  /* the whole screen, clean: no field, no figure; the note set big like the contact line */
  position: fixed; z-index: 75; inset: 0; display: grid; align-content: center; gap: 36px;
  padding: 0 var(--gutter) env(safe-area-inset-bottom, 0px); background: var(--paper);
  animation: explain-in .5s ease;
}
.explain[hidden] { display: none; }
.explain-text {
  margin: 0; max-width: 16ch; font-family: var(--f-contact); font-size: clamp(34px, 5.2vw, 76px); line-height: 1.08; color: var(--ink);
}
.explain-text span { transition: opacity .35s, transform .35s; display: inline-block; }
.explain-text span.off { opacity: 0; transform: translateY(.25em); }
.explain-text .w-m { font-size: .72em; }
.explain-text .w-l { color: var(--orange); }
.explain-actions { display: flex; gap: 10px; flex-wrap: wrap; opacity: 0; transition: opacity .4s; }
.explain.typed-out .explain-actions { opacity: 1; }
@keyframes explain-in { from { opacity: 0; } }

/* ---------- the page corner: always folded, always pullable ---------- */
.page-corner {
  position: fixed; right: 0; bottom: env(safe-area-inset-bottom, 0px); z-index: 60; width: 72px; height: 72px;
  border: 0; padding: 0; background: var(--under); cursor: pointer;
  /* a pixel staircase instead of a plain triangle; now and then it glitches */
  clip-path: var(--stairs-a);
  --stairs-a: polygon(100% 0, 100% 100%, 0 100%, 0 83%, 17% 83%, 17% 67%, 33% 67%, 33% 50%, 50% 50%, 50% 33%, 67% 33%, 67% 17%, 83% 17%, 83% 0);
  --stairs-b: polygon(100% 0, 100% 100%, 0 100%, 0 83%, 25% 83%, 25% 67%, 33% 67%, 33% 58%, 42% 58%, 42% 50%, 50% 50%, 50% 25%, 58% 25%, 58% 17%, 83% 17%, 83% 0);
  --stairs-c: polygon(100% 0, 100% 100%, 8% 100%, 8% 83%, 17% 83%, 17% 75%, 25% 75%, 25% 58%, 42% 58%, 42% 42%, 58% 42%, 58% 33%, 75% 33%, 75% 8%, 92% 8%, 92% 0);
  animation: corner-glitch 3.6s steps(1) infinite;
  transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), opacity .9s;
}
@keyframes corner-glitch {
  0%, 100% { clip-path: var(--stairs-a); transform: none; }
  78% { clip-path: var(--stairs-b); transform: translateX(-3px); }
  80% { clip-path: var(--stairs-c); transform: none; }
  82% { clip-path: var(--stairs-a); }
  90% { clip-path: var(--stairs-c); transform: translate(2px, -2px); }
  91% { clip-path: var(--stairs-a); transform: none; }
}
.page-corner:hover { animation-duration: 1.2s; }
.page-corner:hover, .page-corner:focus-visible { width: 120px; height: 120px; }
.corner-ascii { position: absolute; inset: 0; width: 100%; height: 100%; }
.corner-word {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  font-family: var(--f-buttons); font-size: 12px; color: var(--orange);
}

/* ---------- the turn: the new side opens out from where it was touched ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: peel 1.7s cubic-bezier(.7,0,.2,1); }
@keyframes peel {
  from { clip-path: circle(0 at var(--vx, 100%) var(--vy, 100%)); }
  to   { clip-path: circle(150vmax at var(--vx, 100%) var(--vy, 100%)); }
}

@media (max-width: 860px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door:last-child { grid-column: span 2; }
  .door:last-child .fig { aspect-ratio: 8 / 3; }
  .topic { grid-template-columns: minmax(0, 1fr); }
  .topic .anim { position: relative; top: 0; max-width: 520px; }
  .fold .label { display: none; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .figure-cut { max-width: 380px; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .door, .talk, .name, .page-corner { transition: none; }
  .page-corner { animation: none; }
  .topic:not(.in) .anim, .topic:not(.in) .side { transform: none; opacity: 1; }
}

/* ---------- pixel reveals and gallery loops (pixel.js) ---------- */
/* until a picture has been revealed, only its canvas shows; without GSAP or with reduced motion, nothing is hidden */
.px-on img[data-px]:not(.px-shown) { opacity: 0; }
.px-canvas { position: absolute; pointer-events: none; z-index: 1; }
.px-count {
  position: absolute; z-index: 2; transform: translate(-100%, -100%); margin: -6px 0 0 -6px; padding: 1px 6px;
  background: var(--paper); border-radius: 4px; font: 10px/1.5 var(--f-labels); color: var(--orange);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.px-looping .px-count { opacity: 1; }
.media figure:has(img[data-px]) { cursor: default; }
/* on a small thumbnail the loop speaks for itself */
.thumb + .px-count { display: none; }

/* the index is not shown; a project opened from the search or a topic appears on its own, and goes when closed */
.archive:not(.peek) { display: none; }
.archive.peek > h2, .archive.peek .archive-sub, .archive.peek .worlds, .archive.peek .more, .archive.peek .active-filters { display: none; }
.archive.peek .project:not(.shown) { display: none; }
.archive.peek .projects { border-top: 1px solid var(--line); }
/* the sound the ball makes on the figure: rings drawn on the beat over the page */
.sound-rings { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
/* the new opening: the last line comes in below the other two, which share one place */
.hello .i-3 { grid-area: 2 / 1; margin-top: .4em; }

/* on Tech the contact line is plain white text, not liquid chrome: it has to be read */
.tech .contact-line.lq-on { color: var(--ink) !important; }
.tech .contact-line .lq-canvas { display: none; }

/* phones: no folded triangle on the topics; Safari's bottom bar never covers the corner, the footer or the intro */
@media (max-width: 700px) { .fold .tri { display: none; } }
.intro-screen { height: 100dvh; }
.foot { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }

/* the child's "click to throw" */
.i-hint { position: absolute; z-index: 1; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0;
  font-family: var(--f-labels); font-size: 14px; color: var(--muted); opacity: 0; transition: opacity .4s; pointer-events: none; }
.i-hint.on { opacity: 1; animation: hint-blink 1.08s steps(1) infinite .6s; }
@keyframes hint-blink { 50% { opacity: .25; } }
.intro-screen.hello { cursor: pointer; }

/* Tech's contact sentence, set by weight of meaning */
.tech .contact-line { max-width: 22ch; line-height: 1.08; }
.tech .contact-line .w-m { font-size: .72em; }
.tech .contact-line .w-l { font-size: 1em; color: var(--orange); }
/* the new opening's two sizes */
.hello .i-line .big { font-size: 1.55em; }

/* the opening, drawn flat in the font's own pixels, with a light fuzz */
.lq-flat { filter: url(#fuzz); }
/* the boy: the ball's grainy, boiling edge */
.lq-grain { filter: url(#ball-grain); }
/* the opening's sound switch, bottom left, across from "skip" */
.i-sound { position: absolute; z-index: 3; left: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); padding: 0;
  background: none; border: 0; color: var(--muted); font-family: var(--f-labels); font-size: 13px; cursor: pointer; transition: opacity .35s; }
.i-sound[aria-pressed="true"] { color: var(--orange); }
.lift .i-sound, .pan .i-sound, .melt .i-sound { opacity: 0; }
/* the festival archive: a film strip of the editions, running through */
.sl-archive { margin: 8px 0 28px; }
.sl-archive-title { font-family: var(--display); font-size: clamp(24px, 3.2vw, 34px); line-height: 1.1; margin: 0 0 6px; }
.sl-archive-note { font-size: 14px; color: var(--muted); margin: 0 0 16px; max-width: 46ch; }
.sl-strip { contain: inline-size; overflow: hidden; position: relative; background: #141414; border-block: 10px solid #141414; border-radius: 4px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.sl-strip::before, .sl-strip::after { content: ""; position: absolute; left: 0; right: 0; height: 5px; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--paper) 0 8px, transparent 8px 18px); }
.sl-strip::before { top: -8px; } .sl-strip::after { bottom: -8px; }
.sl-reel { display: flex; gap: 6px; width: max-content; padding: 6px 0; animation: sl-reel 30s linear infinite; }
.sl-strip:hover .sl-reel, .sl-strip:focus-within .sl-reel { animation-play-state: paused; }
.sl-frame { width: 96px; height: 68px; display: grid; place-items: center; background: var(--paper); color: #141414; text-decoration: none;
  font: 20px "Pixel", monospace; transition: background .3s, color .3s; }
.sl-frame:hover, .sl-frame:focus-visible { background: var(--orange); color: #fff; }
@keyframes sl-reel { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sl-reel { animation: none; } .sl-strip { overflow-x: auto; } }

/* a text written shorter for phones ("phone:" in the content files) */
.on-phone { display: none; }
@media (max-width: 700px) { .on-phone { display: block; } .on-wide { display: none; } }
/* phones: nothing may widen the page (the "also" links wrap; drawings sliding in are cut at the edge) */
.related a { display: inline-block; }
.topics { overflow-x: clip; }
/* projects as one picture each (showcase.js): the open one takes the drawing's place */
.g-tiles { columns: 2; column-gap: 12px; margin: 24px 0; }
.g-tile { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; break-inside: avoid; }
.g-pic { display: block; position: relative; }
.g-tile img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--line); }
.g-tile[aria-expanded="true"] .g-pic { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.g-tile:focus-visible { outline: 1.5px solid var(--orange); outline-offset: 5px; border-radius: 6px; }
.g-name { display: block; margin-top: 5px; font-family: var(--f-labels); font-size: 13px; }
.g-tile:hover .g-name, .g-tile[aria-expanded="true"] .g-name { color: var(--orange); }
.g-panel { position: sticky; top: 80px; z-index: 3; max-height: calc(100vh - 100px); overflow-y: auto; outline: 0; scrollbar-width: thin; animation: g-in .7s cubic-bezier(.2,.8,.2,1); }
.g-panel[hidden] { display: none; }
.g-panel h3 { margin: 0 70px 4px 0; font-family: var(--px); font-weight: 400; font-size: 24px; line-height: 1.1; }
.g-panel .g-sub, .g-panel .g-tools, .g-panel figcaption { color: var(--muted); font-family: var(--f-labels); font-size: 13px; margin: 4px 0 14px; }
.g-panel figure { margin: 0 0 12px; }
.g-panel img, .g-panel video { display: block; max-width: 100%; max-height: 75vh; height: auto; border-radius: 6px; }
.g-panel a { color: var(--orange); }
.g-close { position: sticky; top: 0; float: right; z-index: 2; border: 0; border-radius: 4px; padding: 4px 10px; background: var(--paper); color: var(--orange); font-family: var(--f-labels); font-size: 14px; cursor: pointer; }
.g-close:hover { background: var(--orange); color: #fff; }
@keyframes g-in { from { opacity: 0; transform: translateX(60px); } }
@media (min-width: 861px) {
  .g-host > .sides { grid-area: 1 / 1; }
  .g-host > .anim, .g-host > .g-panel { grid-area: 1 / 2; }
  .topic.g-open > .anim { opacity: 0; transform: translateX(90px); pointer-events: none; }
}
@media (max-width: 860px) {
  .g-tiles { columns: auto; display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .g-tile { margin: 0; }
  .g-panel { position: static; max-height: none; grid-column: 1 / -1; padding: 8px 0 16px; }
}
@media (prefers-reduced-motion: reduce) { .g-panel { animation: none; } }

/* Tech: the noise thins out around the words (see the ASCII field in main.js); the words have air */
.tech .side.tech .lead { max-width: 34ch; font-size: clamp(21px, 1.9vw, 27px); line-height: 1.32; margin: 22px 0 26px; text-wrap: balance; }
.tech .side.tech .body p { max-width: 56ch; line-height: 1.65; text-wrap: pretty; color: #f1eee9; }

/* a video in a topic: its still assembles out of pixels (pixel.js), then the video fades in over it */
.v-wrap { display: block; position: relative; overflow: hidden; border-radius: 6px; }
.v-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: none; transition: opacity .8s; }
.px-on .v-wrap img:not(.px-shown) ~ video { opacity: 0; }
.px-on .v-wrap img:not(.px-shown) { background: none; }
/* one picture alone: the whole width of the column */
.media.one { columns: 1; }
#t-festival .side.soft .media { margin: 34px 0 52px; }
#t-festival .sl-archive-title { margin-bottom: 16px; }
/* a note about an edited picture stays with the picture */
.g-note { display: block; margin-top: 2px; color: var(--muted); font-family: var(--f-labels); font-size: 12px; line-height: 1.35; }
/* a project whose first thing is a video plays it in its tile, once the still has assembled */
.g-pic { overflow: hidden; border-radius: 6px; }
.g-pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; pointer-events: none; transition: opacity .8s; }
.px-on .g-pic img:not(.px-shown) ~ video { opacity: 0; }
/* a single project: its picture across the whole column */
.g-tiles.one { columns: 1; }
@media (max-width: 860px) { .g-tiles.one { grid-template-columns: minmax(0, 1fr); } }
/* the address, shown once "Write to me" is clicked */
.contact-copied { margin: 14px 0 0; font-family: var(--f-labels); font-size: 14px; color: var(--muted); }
.contact-copied .addr { color: var(--ink); user-select: all; }
/* the message form */
.contact-form { display: grid; gap: 14px; max-width: 460px; margin: 26px 0 0; animation: g-in .6s cubic-bezier(.2,.8,.2,1); }
.contact-form[hidden] { display: none; }
.contact-form label { display: grid; gap: 5px; font-family: var(--f-labels); font-size: 13px; color: var(--muted); }
.contact-form input, .contact-form textarea { font: inherit; font-size: 16px; color: var(--ink); background: none; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 7px 0; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 0; border-bottom-color: var(--orange); }
.contact-form .btn { justify-self: start; }
.contact-form .btn:disabled { opacity: .5; cursor: default; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-family: var(--f-labels); font-size: 14px; color: var(--ink); min-height: 1em; }
