# Make Way Grid

> A grid of pictures where the one you click takes two by two cells and the others slide out of its way, then its caption card unfolds from the name pill. Two columns in narrow containers.

Image effects · image, grid, gallery, expand, flip, click · HTML, CSS, vanilla JS · no dependencies · updated 2026-11-05
Demo: https://kodza.dev/components/make-way-grid/
Source on GitHub: https://github.com/kodza-dev/kodza/tree/main/components/make-way-grid

## Files

The code below, served as files: byte for byte what the Kodza site copies (the CSS includes its theme guard).

- [`kodza-make-way-grid.css`](https://kodza.dev/registry/make-way-grid/kodza-make-way-grid.css) · 17.6 KB
- [`kodza-make-way-grid.js`](https://kodza.dev/registry/make-way-grid/kodza-make-way-grid.js) · 14.0 KB
- [`kodza-make-way-grid.html`](https://kodza.dev/registry/make-way-grid/kodza-make-way-grid.html) · 6.0 KB · the markup, to adapt and paste into your page

**Can you run shell commands? Download the CSS and the JS, don't retype them.** Retyping costs thousands of tokens and can drop or change lines of the CSS. Put the files where your stack expects them (Use it says where: change the `-o` paths):

```bash
curl -fsSL --create-dirs -o kodza/kodza-make-way-grid.css https://kodza.dev/registry/make-way-grid/kodza-make-way-grid.css
curl -fsSL --create-dirs -o kodza/kodza-make-way-grid.js https://kodza.dev/registry/make-way-grid/kodza-make-way-grid.js
```

Then load the files from your page as Use it shows, instead of pasting the content. The HTML is the part you adapt (text, links, modifiers): paste it from the Code section. Copy the CSS and the JS from the Code section only if you can't run commands, exactly as they are. (Windows PowerShell: `curl.exe`.)

**Its images are free to use in what you ship** (Kodza house images, Kodza License). The HTML loads them from kodza.dev, whose addresses can change: copy them into the project and point each `src` to the copy (a Claude artifact embeds them instead, as Use it says).

```bash
curl -fsSL --create-dirs -o kodza/media/kz-float-1400.webp https://kodza.dev/media/kz-float-1400.webp
curl -fsSL --create-dirs -o kodza/media/kz-stack-1400.webp https://kodza.dev/media/kz-stack-1400.webp
curl -fsSL --create-dirs -o kodza/media/kz-steps-1400.webp https://kodza.dev/media/kz-steps-1400.webp
curl -fsSL --create-dirs -o kodza/media/kz-columns-1400.webp https://kodza.dev/media/kz-columns-1400.webp
curl -fsSL --create-dirs -o kodza/media/kz-arch-1400.webp https://kodza.dev/media/kz-arch-1400.webp
curl -fsSL --create-dirs -o kodza/media/kz-overflow-1400.webp https://kodza.dev/media/kz-overflow-1400.webp
```

## API

- Root: `.kodza-make-way`
- Variables (set them on the root element itself: it declares its own defaults):
  - `--kz-make-way-columns: 3`
  - `--kz-make-way-columns-small: 2` — under 560px of container
  - `--kz-make-way-ratio: 0.75` — row height for a column width of 1
  - `--kz-make-way-ratio-small: 1`
  - `--kz-make-way-span: 2` — cells the open picture takes, across and down
  - `--kz-make-way-gap: 12px`
  - `--kz-make-way-inset: 16px` — pill, card and close button, from the picture's edges
  - `--kz-make-way-inset-small: 10px`
  - `--kz-make-way-card: 340px` — the card's widest
  - `--kz-make-way-radius: calc(16px * var(--kz-radius-scale, 1))`
  - `--kz-make-way-card-radius: calc(12px * var(--kz-radius-scale, 1))`
  - `--kz-make-way-bg: #e9e9e6` — behind a picture still loading
  - `--kz-make-way-pill-bg: #ffffff` — pill, card and close button
  - `--kz-make-way-pill-fg: #0a0a0a`
  - `--kz-make-way-muted: rgba(10, 10, 10, 0.64)`
  - `--kz-make-way-focus: #0a0a0a`
  - `--kz-make-way-line: transparent` — a hairline round each picture, for dark pictures on a dark page
- Lifecycle: `kodza:init` / `kodza:destroy` on `document`, with `{ detail: { root } }` to target a container.

## Keyboard

What each key does, by where the focus is. Keep it working when you adapt the HTML: same elements, same classes.

- On a picture (focus in `.kodza-make-way__toggle`):
  - `Enter` / `Space`: Opens it, or closes it
  - `ArrowLeft` / `ArrowRight`: Previous or next picture, opened if one is open
  - `Home` / `End`: First or last picture
- Anywhere, while one is open (while `.kodza-make-way__item.is-open` is on the page):
  - `Escape`: Closes it, focus back on the picture

## Images

The shape of each image slot, measured in the demo at 1440 × 900 (desktop) and 390 × 844 (mobile). Where the shape is fixed, the frame crops the image to it: export in that shape, keep the subject near the centre, at twice the widest size shown (sharp on retina screens).

| Slot | Desktop | Mobile | Widest shown |
| --- | --- | --- | --- |
| `.kodza-make-way__image` | 4:3 | 1:1 | 299 px |

## Dark mode

The values Kodza uses on a dark background (`#0a0a0a`). For a page that follows the system theme, add them after the component's CSS:

```css
@media (prefers-color-scheme: dark) {
  .kodza-make-way {
    --kz-make-way-bg: #1c1c1c;
    --kz-make-way-pill-bg: #161616;
    --kz-make-way-pill-fg: #f2f2f0;
    --kz-make-way-muted: rgba(242, 242, 240, 0.62);
    --kz-make-way-focus: #f2f2f0;
    --kz-make-way-line: rgba(255, 255, 255, 0.12);
  }
}
```

A site with its own theme switch puts the same rules under its dark selector instead (`[data-theme="dark"] .kodza-make-way { … }`); a single dark section, under that section's class.

Its images have dark versions next to them (`kz-float-1400.webp` → `kz-float-dark-1400.webp`). To swap them on a dark page: `<picture><source media="(prefers-color-scheme: dark)" srcset="…-dark-….webp"><img …></picture>`.

## Use it

### Plain HTML page

- CSS: `kodza/kodza-make-way-grid.css` next to the page (the Files commands as they are), linked in `<head>`: `<link rel="stylesheet" href="kodza/kodza-make-way-grid.css">`. Without a shell, paste it in a `<style>` in `<head>` instead. It only touches `kodza-` classes.
- HTML: where the component goes. Paste it as many times as you need: instances never interfere.
- JS: `kodza/kodza-make-way-grid.js`, loaded with `<script src="kodza/kodza-make-way-grid.js" defer></script>` in `<head>`. Without a shell, paste it in a `<script>` before `</body>` (or in `<head>`: it waits for the page). One copy per page, whatever the number of instances.
- Restyle with the `--kz-…` variables, set on the component's root element itself (the root declares its own defaults, so a value on an ancestor is ignored), and with the modifiers / attributes listed under API.
- Font: it takes the page's own. A site with its own type sets it once for every Kodza component, on `:root`, never by editing the CSS (unset, nothing changes): `--kz-font-display`, the display face (headings, big numbers, wordmarks); `--kz-font-display-weight`, its weight; `--kz-font-display-scale`, a multiplier on its sizes (1 by default); `--kz-font-display-tracking`, its letter-spacing; `--kz-font-display-case`, its case (`uppercase`…); `--kz-font-label`, the face of the small labels (meta, captions, counters, hints, footer links, button labels); `--kz-font-label-size`, their size, one for all of them (`11px`…); `--kz-font-label-weight`, their weight; `--kz-font-label-tracking`, their letter-spacing; `--kz-font-label-case`, their case (`uppercase`…; code and units keep theirs); `--kz-font-label-leading`, their line-height (`1.45`…; buttons, pills and keys keep their box); `--kz-font-mono`, the monospace face (code, labels, counters). The Kodza look is Geist: `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap">`.
- Corners: a site with its own shapes sets them once for every Kodza component, on `:root`, never by editing the CSS (unset, nothing changes): `--kz-radius-scale` multiplies every corner (`0` square, `0.5` softer, `1` Kodza); `--kz-radius-pill` sets the pills (`0` squares them).
- Motion: a site sets its pace once for every Kodza component, on `:root`, never by editing the CSS or the JS: `--kz-motion-scale` multiplies every duration (`0.5` twice as fast, `2` twice as slow, `0` no motion at all, loops stopped, like reduced motion). Unset, nothing changes.
- Content added later (AJAX navigation, a SPA route, a builder preview): start it with `document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root: container } }))`; before removing it, the same call with `'kodza:destroy'` stops it and puts the original markup back.

### Claude artifact (claude.ai)

- Paste the CSS in a `<style>` and the JS in a `<script>` at the end, in the artifact itself: it loads stylesheets only from Google Fonts and scripts only from a few CDNs, so no `<link>` or `<script src>` to Kodza.
- Writing the artifact file with a shell? Insert the downloaded files (Files) with a command instead of retyping them: a line `KODZA-CSS` alone inside the `<style>`, `KODZA-JS` inside the `<script>`, then `sed -e '/^KODZA-CSS$/{r kodza/kodza-make-way-grid.css' -e 'd' -e '}' -e '/^KODZA-JS$/{r kodza/kodza-make-way-grid.js' -e 'd' -e '}' page.html > artifact.html`.
- Font: load Geist from Google Fonts (allowed): `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap">`. A site with its own type sets it once for every Kodza component, on `:root`, never by editing the CSS (unset, nothing changes): `--kz-font-display`, the display face (headings, big numbers, wordmarks); `--kz-font-display-weight`, its weight; `--kz-font-display-scale`, a multiplier on its sizes (1 by default); `--kz-font-display-tracking`, its letter-spacing; `--kz-font-display-case`, its case (`uppercase`…); `--kz-font-label`, the face of the small labels (meta, captions, counters, hints, footer links, button labels); `--kz-font-label-size`, their size, one for all of them (`11px`…); `--kz-font-label-weight`, their weight; `--kz-font-label-tracking`, their letter-spacing; `--kz-font-label-case`, their case (`uppercase`…; code and units keep theirs); `--kz-font-label-leading`, their line-height (`1.45`…; buttons, pills and keys keep their box); `--kz-font-mono`, the monospace face (code, labels, counters).
- Corners: a site with its own shapes sets them once for every Kodza component, on `:root`, never by editing the CSS (unset, nothing changes): `--kz-radius-scale` multiplies every corner (`0` square, `0.5` softer, `1` Kodza); `--kz-radius-pill` sets the pills (`0` squares them).
- Motion: a site sets its pace once for every Kodza component, on `:root`, never by editing the CSS or the JS: `--kz-motion-scale` multiplies every duration (`0.5` twice as fast, `2` twice as slow, `0` no motion at all, loops stopped, like reduced motion). Unset, nothing changes.
- Images: the artifact blocks every other host, `kodza.dev` included, without an error. Embed each one as a `data:` URI, with a command if you can run one (`curl -s <url> | base64`; the 1400 px files weigh 10 to 30 KB), never by typing base64 out. If you can't run commands, keep the `<img>` with its `width` and `height`, and tell the user the picture stays blank inside the artifact.
- Dark mode: the viewer sets `data-theme="dark"` or `"light"` on `<html>`, or nothing when it follows the system. Write the Dark mode rules twice: inside `@media (prefers-color-scheme: dark)` with `:root:not([data-theme="light"])` in front of each selector, and with `:root[data-theme="dark"]` in front of each selector.

### WordPress

- HTML: a **Custom HTML** block (or a pattern / template part). WordPress keeps this markup as it is only for users allowed to post unfiltered HTML (Administrators; Super Admins on multisite): for anyone else it strips tags such as `<svg>`, `<input>` or `<dialog>`, so add it from the theme (a pattern or template part) instead.
- CSS and JS: the downloaded files go in the theme, under `wp-content/themes/<your-theme>/kodza/` (the child theme if there is one), enqueued from its functions.php (or a code-snippets plugin):
  ```php
  add_action('wp_enqueue_scripts', function () {
    $dir = get_stylesheet_directory() . '/kodza/';
    $uri = get_stylesheet_directory_uri() . '/kodza/';
    wp_enqueue_style('kodza-make-way-grid', $uri . 'kodza-make-way-grid.css', [], filemtime($dir . 'kodza-make-way-grid.css'));
    wp_enqueue_script('kodza-make-way-grid', $uri . 'kodza-make-way-grid.js', [], filemtime($dir . 'kodza-make-way-grid.js'), true);
  });
  ```
  Scoped to `kodza-` classes, the CSS never touches the theme. One copy of the JS, whatever the number of blocks.
- No access to the theme files? The CSS can also go, as it is, in **Appearance → Customize → Additional CSS** (classic theme) or **Styles → Additional CSS** in the Site Editor (block theme).
- Theme with AJAX page transitions: fire `kodza:init` on the new content after each swap (and `kodza:destroy` on the old one).
- Performance plugin (WP Rocket, LiteSpeed Cache, Perfmatters…) with **Delay JavaScript execution** turned on: add `kodza` to the scripts it must not delay. Otherwise the component waits for the visitor's first scroll, tap or mouse move, and that first click can be lost.
- Colours: it takes the colour of the text around it (or keeps its own monochrome): nothing to point at the theme.
- WordPress turns straight quotes and `--` into typographic ones in the text of a Custom HTML block (not inside `<code>` or `<pre>`).

#### With Elementor

- HTML: an **HTML** widget (Elementor shows it to administrators only). It keeps the code exactly as pasted, straight quotes included.
- CSS and JS: as above. Elementor's Site Settings → Theme Style styles every button, field, link and image of the page, components included; the theme guard at the end of the CSS keeps the component's buttons, fields and link colours as they are.
- The Elementor editor redraws each widget after the page has loaded: without the script below, the component stays still in the editor preview (the published page works). Add it once per site, in the footer like the component's script (`kodza/elementor-editor.js`, or a code-snippets plugin):

```js
// Kodza in the Elementor editor: the editor redraws each HTML widget after the page has loaded.
// Start Kodza in what it draws, stop it in what it replaces or removes. Once per site.
window.addEventListener('elementor/frontend/init', () => {
  if (!elementorFrontend.isEditMode()) return;
  class KodzaWidget extends elementorModules.frontend.handlers.Base {
    onInit() {
      super.onInit();
      this.kodza = [...this.$element[0].children];
      document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root: this.$element[0] } }));
    }
    onDestroy() {
      super.onDestroy();
      this.kodza.forEach((root) => document.dispatchEvent(new CustomEvent('kodza:destroy', { detail: { root } })));
    }
  }
  elementorFrontend.elementsHandler.attachHandler('html', KodzaWidget);
});
```

- No child theme: everything can go in the HTML widget instead, `<style>` with the CSS, the HTML, then `<script>` with the JS. It works on the page and in the editor without the script above.

### Shopify

- Files: `assets/kodza-make-way-grid.css` and `assets/kodza-make-way-grid.js` (the Files commands with `-o assets/…`).
- In the section: `{{ 'kodza-make-way-grid.css' | asset_url | stylesheet_tag }}` and `<script src="{{ 'kodza-make-way-grid.js' | asset_url }}" defer></script>`, then the HTML.
- The theme editor re-renders sections: restart them with
  `document.addEventListener('shopify:section:load', (e) => document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root: e.target } })));`
  and the same with `shopify:section:unload` → `kodza:destroy`.

### React / Next.js

- Files, side by side (e.g. in `components/kodza/`): `MakeWayGrid.tsx` (below), the CSS block under Code saved as `make-way-grid.css` and the JS block as `make-way-grid.js`, both as they are. The HTML block is already inside the component: skip it.
- Use it: `import { MakeWayGrid } from '@/components/kodza/MakeWayGrid';` then `<MakeWayGrid />`. Props: `vars` (the `--kz-…` variables listed under API, e.g. `vars={{ '--kz-make-way-columns': … }}`), `className`, `style` and the other props of its `<div>` (`onClick`, `aria-…`).
- Next.js App Router: it is a Client Component already (`'use client'`). Pages Router: Next.js takes global CSS only in `pages/_app`, so move the `import './make-way-grid.css'` line there.
- Safe under StrictMode, client-side navigation and prop changes: when a prop changes, the `key` gives React a fresh element, `kodza:destroy` stops the script on the old one and `kodza:init` starts it on the new one.
- Built from your data (tabs, rows, options)? Add what the markup is made of to the `key`, as plain values (ids, text, numbers). What the visitor changes (the open tab, the sort, what they type) is the script's: follow it with `onClick` or `onInput` on the root, and change it from your code as a visitor would (click the tab; set the field's value, then dispatch a bubbling `input` event). Fields stay uncontrolled (`defaultValue`, `name`).

```tsx
'use client';
// Kodza — Make Way Grid, for React. From https://kodza.dev/components/make-way-grid/
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Next to this file: make-way-grid.css and make-way-grid.js, the component's CSS and JS from Kodza, as they are.
// Yours to edit: the markup is plain JSX below.
// The script changes this markup once React has rendered it (it adds layers, splits text, moves
// nodes), so React must not patch it afterwards. When a prop changes, the key gives React a fresh
// element: kodza:destroy stops the script on the old one, kodza:init starts it on the new one.
// data-kodza-manual keeps the script from starting it on its own: the effect below does, once
// React has hydrated the markup (on a page that streams in, the script can load first).
// Built from your data (tabs, rows, options)? Put what the markup is made of in the key, as plain
// values (ids, text, numbers): a change starts the script again on fresh markup. What the visitor
// changes (the open tab, the sort, what they type) is the script's: keep it out of the key, follow
// it with onClick or onInput on the root, and change it from your code as a visitor would (click
// the tab; set the field's value, then dispatch a bubbling input event).
import { useRef, useEffect, type ComponentPropsWithoutRef, type ComponentRef, type CSSProperties } from 'react';
import './make-way-grid.css';

export type MakeWayGridProps = Omit<ComponentPropsWithoutRef<'div'>, "children" | "vars"> & {
  /** Settings, as CSS variables on the root */
  vars?: {
    /** default: 3 */
    "--kz-make-way-columns"?: string | number;
    /** under 560px of container — default: 2 */
    "--kz-make-way-columns-small"?: string | number;
    /** row height for a column width of 1 — default: 0.75 */
    "--kz-make-way-ratio"?: string | number;
    /** default: 1 */
    "--kz-make-way-ratio-small"?: string | number;
    /** cells the open picture takes, across and down — default: 2 */
    "--kz-make-way-span"?: string | number;
    /** default: 12px */
    "--kz-make-way-gap"?: string | number;
    /** pill, card and close button, from the picture's edges — default: 16px */
    "--kz-make-way-inset"?: string | number;
    /** default: 10px */
    "--kz-make-way-inset-small"?: string | number;
    /** the card's widest — default: 340px */
    "--kz-make-way-card"?: string | number;
    /** default: calc(16px * var(--kz-radius-scale, 1)) */
    "--kz-make-way-radius"?: string | number;
    /** default: calc(12px * var(--kz-radius-scale, 1)) */
    "--kz-make-way-card-radius"?: string | number;
    /** behind a picture still loading — default: #e9e9e6 */
    "--kz-make-way-bg"?: string | number;
    /** pill, card and close button — default: #ffffff */
    "--kz-make-way-pill-bg"?: string | number;
    /** default: #0a0a0a */
    "--kz-make-way-pill-fg"?: string | number;
    /** default: rgba(10, 10, 10, 0.64) */
    "--kz-make-way-muted"?: string | number;
    /** default: #0a0a0a */
    "--kz-make-way-focus"?: string | number;
    /** a hairline round each picture, for dark pictures on a dark page — default: transparent */
    "--kz-make-way-line"?: string | number;
  };
  className?: string;
};

export function MakeWayGrid({ vars, className, style, ...rest }: MakeWayGridProps) {
  const ref = useRef<ComponentRef<'div'>>(null);
  const classes = ["kodza-make-way", className].filter(Boolean).join(' ');
  // Everything the markup is made of: when it changes, React gets a fresh element (see the top)
  const key = JSON.stringify([classes, vars, style, rest]);

  // Starts the script on this element once React has rendered it, stops it when it goes
  useEffect(() => {
    const root = ref.current;
    let live = true;
    // @ts-ignore: a plain script, no types to find
    import('./make-way-grid.js').then(() => {
      if (live) document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root } }));
    });
    return () => {
      live = false;
      document.dispatchEvent(new CustomEvent('kodza:destroy', { detail: { root } }));
    };
  }, [key]);

  return (
    <div key={key} {...rest} className={classes} data-kodza-manual style={{ ...vars, ...style } as CSSProperties} ref={ref}>
      <ul className="kodza-make-way__grid">
        <li className="kodza-make-way__item">
          <div className="kodza-make-way__frame">
            <img className="kodza-make-way__image" src="https://kodza.dev/media/kz-float-1400.webp" width="1400" height="933" alt="A concrete block hovering above the ground, over its own shadow" loading="lazy" />
            {' '}
            <button className="kodza-make-way__toggle" type="button" aria-expanded="false">
              <span className="kodza-make-way__label">
                <span className="kodza-make-way__label-inner">
                  <span className="kodza-make-way__index">01</span>
                  {' '}
                  <span className="kodza-make-way__name">Float House</span>
                </span>
              </span>
              {' '}
              <span className="kodza-make-way__close" aria-hidden="true" />
            </button>
            <div className="kodza-make-way__details">
              <h3 className="kodza-make-way__title">Float House</h3>
              <p className="kodza-make-way__meta">Le Havre · 2026 · 180 m²</p>
              <p className="kodza-make-way__text">One cantilever, no hidden supports. The structure does what the drawings said it would.</p>
            </div>
          </div>
        </li>
        <li className="kodza-make-way__item">
          <div className="kodza-make-way__frame">
            <img className="kodza-make-way__image" src="https://kodza.dev/media/kz-stack-1400.webp" width="1400" height="1050" alt="Three concrete slabs stacked at slightly different angles" loading="lazy" />
            {' '}
            <button className="kodza-make-way__toggle" type="button" aria-expanded="false">
              <span className="kodza-make-way__label">
                <span className="kodza-make-way__label-inner">
                  <span className="kodza-make-way__index">02</span>
                  {' '}
                  <span className="kodza-make-way__name">Stack Tower</span>
                </span>
              </span>
              {' '}
              <span className="kodza-make-way__close" aria-hidden="true" />
            </button>
            <div className="kodza-make-way__details">
              <h3 className="kodza-make-way__title">Stack Tower</h3>
              <p className="kodza-make-way__meta">Rotterdam · 2025 · 12 floors</p>
              <p className="kodza-make-way__text">Twelve floors, each one turned a little. Nobody asked for a twist. The wind did.</p>
            </div>
          </div>
        </li>
        <li className="kodza-make-way__item">
          <div className="kodza-make-way__frame">
            <img className="kodza-make-way__image" src="https://kodza.dev/media/kz-steps-1400.webp" width="1400" height="933" alt="Concrete steps climbing towards the light" loading="lazy" />
            {' '}
            <button className="kodza-make-way__toggle" type="button" aria-expanded="false">
              <span className="kodza-make-way__label">
                <span className="kodza-make-way__label-inner">
                  <span className="kodza-make-way__index">03</span>
                  {' '}
                  <span className="kodza-make-way__name">Steps Library</span>
                </span>
              </span>
              {' '}
              <span className="kodza-make-way__close" aria-hidden="true" />
            </button>
            <div className="kodza-make-way__details">
              <h3 className="kodza-make-way__title">Steps Library</h3>
              <p className="kodza-make-way__meta">Porto · 2024 · 2 400 m²</p>
              <p className="kodza-make-way__text">The stairs are the reading room. Sit anywhere. The books come down to you.</p>
            </div>
          </div>
        </li>
        <li className="kodza-make-way__item">
          <div className="kodza-make-way__frame">
            <img className="kodza-make-way__image" src="https://kodza.dev/media/kz-columns-1400.webp" width="1120" height="1400" alt="A row of square concrete pillars under a flat roof, casting striped shadows" loading="lazy" />
            {' '}
            <button className="kodza-make-way__toggle" type="button" aria-expanded="false">
              <span className="kodza-make-way__label">
                <span className="kodza-make-way__label-inner">
                  <span className="kodza-make-way__index">04</span>
                  {' '}
                  <span className="kodza-make-way__name">Columns Hall</span>
                </span>
              </span>
              {' '}
              <span className="kodza-make-way__close" aria-hidden="true" />
            </button>
            <div className="kodza-make-way__details">
              <h3 className="kodza-make-way__title">Columns Hall</h3>
              <p className="kodza-make-way__meta">Bilbao · 2023 · 1 100 m²</p>
              <p className="kodza-make-way__text">Forty pillars, one roof. The shadows tell the time better than the clock in the lobby.</p>
            </div>
          </div>
        </li>
        <li className="kodza-make-way__item">
          <div className="kodza-make-way__frame">
            <img className="kodza-make-way__image" src="https://kodza.dev/media/kz-arch-1400.webp" width="1400" height="1400" alt="A concrete wall with a round-topped opening, sunlight pouring through it" loading="lazy" />
            {' '}
            <button className="kodza-make-way__toggle" type="button" aria-expanded="false">
              <span className="kodza-make-way__label">
                <span className="kodza-make-way__label-inner">
                  <span className="kodza-make-way__index">05</span>
                  {' '}
                  <span className="kodza-make-way__name">Arch Pavilion</span>
                </span>
              </span>
              {' '}
              <span className="kodza-make-way__close" aria-hidden="true" />
            </button>
            <div className="kodza-make-way__details">
              <h3 className="kodza-make-way__title">Arch Pavilion</h3>
              <p className="kodza-make-way__meta">Marseille · 2026 · 90 m²</p>
              <p className="kodza-make-way__text">One wall, one opening. The light does the rest, and it never sends an invoice.</p>
            </div>
          </div>
        </li>
        <li className="kodza-make-way__item">
          <div className="kodza-make-way__frame">
            <img className="kodza-make-way__image" src="https://kodza.dev/media/kz-overflow-1400.webp" width="1400" height="1400" alt="A two-storey concrete house, its upper floor cantilevered over the ground" loading="lazy" />
            {' '}
            <button className="kodza-make-way__toggle" type="button" aria-expanded="false">
              <span className="kodza-make-way__label">
                <span className="kodza-make-way__label-inner">
                  <span className="kodza-make-way__index">06</span>
                  {' '}
                  <span className="kodza-make-way__name">Overflow Studio</span>
                </span>
              </span>
              {' '}
              <span className="kodza-make-way__close" aria-hidden="true" />
            </button>
            <div className="kodza-make-way__details">
              <h3 className="kodza-make-way__title">Overflow Studio</h3>
              <p className="kodza-make-way__meta">Nantes · 2025 · 140 m²</p>
              <p className="kodza-make-way__text">The upper floor overflows its box. In CSS that's a bug. Here it's the view.</p>
            </div>
          </div>
        </li>
      </ul>
    </div>
  );
}
```

## Code

```html
<div class="kodza-make-way">
  <ul class="kodza-make-way__grid">
    <li class="kodza-make-way__item">
      <div class="kodza-make-way__frame">
        <img class="kodza-make-way__image" src="https://kodza.dev/media/kz-float-1400.webp" width="1400" height="933" alt="A concrete block hovering above the ground, over its own shadow" loading="lazy">
        <button class="kodza-make-way__toggle" type="button" aria-expanded="false">
          <span class="kodza-make-way__label"><span class="kodza-make-way__label-inner"><span class="kodza-make-way__index">01</span> <span class="kodza-make-way__name">Float House</span></span></span>
          <span class="kodza-make-way__close" aria-hidden="true"></span>
        </button>
        <div class="kodza-make-way__details">
          <h3 class="kodza-make-way__title">Float House</h3>
          <p class="kodza-make-way__meta">Le Havre · 2026 · 180&nbsp;m²</p>
          <p class="kodza-make-way__text">One cantilever, no hidden supports. The structure does what the drawings said it would.</p>
        </div>
      </div>
    </li>
    <li class="kodza-make-way__item">
      <div class="kodza-make-way__frame">
        <img class="kodza-make-way__image" src="https://kodza.dev/media/kz-stack-1400.webp" width="1400" height="1050" alt="Three concrete slabs stacked at slightly different angles" loading="lazy">
        <button class="kodza-make-way__toggle" type="button" aria-expanded="false">
          <span class="kodza-make-way__label"><span class="kodza-make-way__label-inner"><span class="kodza-make-way__index">02</span> <span class="kodza-make-way__name">Stack Tower</span></span></span>
          <span class="kodza-make-way__close" aria-hidden="true"></span>
        </button>
        <div class="kodza-make-way__details">
          <h3 class="kodza-make-way__title">Stack Tower</h3>
          <p class="kodza-make-way__meta">Rotterdam · 2025 · 12&nbsp;floors</p>
          <p class="kodza-make-way__text">Twelve floors, each one turned a little. Nobody asked for a twist. The wind did.</p>
        </div>
      </div>
    </li>
    <li class="kodza-make-way__item">
      <div class="kodza-make-way__frame">
        <img class="kodza-make-way__image" src="https://kodza.dev/media/kz-steps-1400.webp" width="1400" height="933" alt="Concrete steps climbing towards the light" loading="lazy">
        <button class="kodza-make-way__toggle" type="button" aria-expanded="false">
          <span class="kodza-make-way__label"><span class="kodza-make-way__label-inner"><span class="kodza-make-way__index">03</span> <span class="kodza-make-way__name">Steps Library</span></span></span>
          <span class="kodza-make-way__close" aria-hidden="true"></span>
        </button>
        <div class="kodza-make-way__details">
          <h3 class="kodza-make-way__title">Steps Library</h3>
          <p class="kodza-make-way__meta">Porto · 2024 · 2&nbsp;400&nbsp;m²</p>
          <p class="kodza-make-way__text">The stairs are the reading room. Sit anywhere. The books come down to you.</p>
        </div>
      </div>
    </li>
    <li class="kodza-make-way__item">
      <div class="kodza-make-way__frame">
        <img class="kodza-make-way__image" src="https://kodza.dev/media/kz-columns-1400.webp" width="1120" height="1400" alt="A row of square concrete pillars under a flat roof, casting striped shadows" loading="lazy">
        <button class="kodza-make-way__toggle" type="button" aria-expanded="false">
          <span class="kodza-make-way__label"><span class="kodza-make-way__label-inner"><span class="kodza-make-way__index">04</span> <span class="kodza-make-way__name">Columns Hall</span></span></span>
          <span class="kodza-make-way__close" aria-hidden="true"></span>
        </button>
        <div class="kodza-make-way__details">
          <h3 class="kodza-make-way__title">Columns Hall</h3>
          <p class="kodza-make-way__meta">Bilbao · 2023 · 1&nbsp;100&nbsp;m²</p>
          <p class="kodza-make-way__text">Forty pillars, one roof. The shadows tell the time better than the clock in the lobby.</p>
        </div>
      </div>
    </li>
    <li class="kodza-make-way__item">
      <div class="kodza-make-way__frame">
        <img class="kodza-make-way__image" src="https://kodza.dev/media/kz-arch-1400.webp" width="1400" height="1400" alt="A concrete wall with a round-topped opening, sunlight pouring through it" loading="lazy">
        <button class="kodza-make-way__toggle" type="button" aria-expanded="false">
          <span class="kodza-make-way__label"><span class="kodza-make-way__label-inner"><span class="kodza-make-way__index">05</span> <span class="kodza-make-way__name">Arch Pavilion</span></span></span>
          <span class="kodza-make-way__close" aria-hidden="true"></span>
        </button>
        <div class="kodza-make-way__details">
          <h3 class="kodza-make-way__title">Arch Pavilion</h3>
          <p class="kodza-make-way__meta">Marseille · 2026 · 90&nbsp;m²</p>
          <p class="kodza-make-way__text">One wall, one opening. The light does the rest, and it never sends an invoice.</p>
        </div>
      </div>
    </li>
    <li class="kodza-make-way__item">
      <div class="kodza-make-way__frame">
        <img class="kodza-make-way__image" src="https://kodza.dev/media/kz-overflow-1400.webp" width="1400" height="1400" alt="A two-storey concrete house, its upper floor cantilevered over the ground" loading="lazy">
        <button class="kodza-make-way__toggle" type="button" aria-expanded="false">
          <span class="kodza-make-way__label"><span class="kodza-make-way__label-inner"><span class="kodza-make-way__index">06</span> <span class="kodza-make-way__name">Overflow Studio</span></span></span>
          <span class="kodza-make-way__close" aria-hidden="true"></span>
        </button>
        <div class="kodza-make-way__details">
          <h3 class="kodza-make-way__title">Overflow Studio</h3>
          <p class="kodza-make-way__meta">Nantes · 2025 · 140&nbsp;m²</p>
          <p class="kodza-make-way__text">The upper floor overflows its box. In CSS that's a bug. Here it's the view.</p>
        </div>
      </div>
    </li>
  </ul>
</div>
```

```css
/* Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license */
/* Kodza — Make Way Grid
   A grid of pictures, one open at a time: the one you click takes two by two cells and the
   others slide out of its way, then its card unfolds from the name pill and its text rises
   line by line. Two columns in narrow containers.
   Tuned with the --kz-make-way-* variables; the script's timing sits under its SELECTOR. */
.kodza-make-way {
  --kz-make-way-columns: 3;
  --kz-make-way-columns-small: 2; /* under 560px of container */
  --kz-make-way-ratio: 0.75; /* row height for a column width of 1 */
  --kz-make-way-ratio-small: 1;
  --kz-make-way-span: 2; /* cells the open picture takes, across and down */
  --kz-make-way-gap: 12px;
  --kz-make-way-inset: 16px; /* pill, card and close button, from the picture's edges */
  --kz-make-way-inset-small: 10px;
  --kz-make-way-card: 340px; /* the card's widest */
  --kz-make-way-radius: calc(16px * var(--kz-radius-scale, 1));
  --kz-make-way-card-radius: calc(12px * var(--kz-radius-scale, 1));
  --kz-make-way-bg: #e9e9e6; /* behind a picture still loading */
  --kz-make-way-pill-bg: #ffffff; /* pill, card and close button */
  --kz-make-way-pill-fg: #0a0a0a;
  --kz-make-way-muted: rgba(10, 10, 10, 0.64);
  --kz-make-way-focus: #0a0a0a;
  --kz-make-way-line: transparent; /* a hairline round each picture, for dark pictures on a dark page */

  container: kodza-make-way / inline-size;
}

.kodza-make-way__grid {
  --kz-make-way-cols: var(--kz-make-way-columns);
  --kz-make-way-rows: var(--kz-make-way-ratio);
  --kz-make-way-pad: var(--kz-make-way-inset);
  --kz-make-way-col: calc((100cqi - (var(--kz-make-way-cols) - 1) * var(--kz-make-way-gap)) / var(--kz-make-way-cols));
  --kz-make-way-across: min(var(--kz-make-way-span), var(--kz-make-way-cols));

  display: grid;
  grid-template-columns: repeat(var(--kz-make-way-cols), minmax(0, 1fr));
  grid-auto-rows: calc(var(--kz-make-way-col) * var(--kz-make-way-rows));
  gap: var(--kz-make-way-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  isolation: isolate;
}

.kodza-make-way__item {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0;
}

/* The open picture passes over the others, the one closing over the rest */
.kodza-make-way__item.is-open {
  z-index: 2;
}

.kodza-make-way__item.is-leaving {
  z-index: 1;
}

/* The script slides and resizes the frame from its old cells to its new ones */
.kodza-make-way__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--kz-make-way-radius);
  background: var(--kz-make-way-bg);
}

.kodza-make-way__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--kz-make-way-line);
  pointer-events: none;
}

.kodza-make-way__frame:has(.kodza-make-way__toggle:focus-visible) {
  outline: 2px solid var(--kz-make-way-focus);
  outline-offset: 3px;
}

.kodza-make-way__image {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  transition: transform calc(0.9s * var(--kz-motion-scale, 1)) cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .kodza-make-way__item:not(.is-open):hover .kodza-make-way__image {
    transform: scale(1.04);
  }
}

/* The button covers the whole picture: click anywhere on it to open, again to close */
.kodza-make-way__toggle {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.kodza-make-way__toggle:focus-visible {
  outline: none;
}

/* The name pill. Hidden once open, still read by screen readers: the card takes its place */
.kodza-make-way__label {
  position: absolute;
  bottom: var(--kz-make-way-pad);
  left: var(--kz-make-way-pad);
  display: block;
  max-width: calc(100% - 2 * var(--kz-make-way-pad));
  height: 34px;
  padding: 0 14px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--kz-radius-pill, 999px);
  background: var(--kz-make-way-pill-bg);
  color: var(--kz-make-way-pill-fg);
  font-family: var(--kz-font-label, inherit);
  font-size: var(--kz-font-label-size, 13px);
  font-weight: var(--kz-font-label-weight, 500);
  letter-spacing: var(--kz-font-label-tracking, inherit);
  text-transform: var(--kz-font-label-case, inherit);
  line-height: 34px;
  text-align: left;
  white-space: nowrap;
  transition: opacity 0s linear calc(0.4s * var(--kz-motion-scale, 1));
}

.kodza-make-way__label-inner {
  display: block;
  height: 100%;
  transition: transform calc(0.35s * var(--kz-motion-scale, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(0.4s * var(--kz-motion-scale, 1));
}

.kodza-make-way__index {
  margin-right: 4px;
  color: var(--kz-make-way-muted);
  font-family: var(--kz-font-label, var(--kz-font-mono, ui-monospace, "SF Mono", Menlo, monospace));
  font-size: var(--kz-font-label-size, 11px);
}

.kodza-make-way__item.is-open .kodza-make-way__label {
  opacity: 0;
  transition: opacity 0s linear calc(0.2s * var(--kz-motion-scale, 1));
}

.kodza-make-way__item.is-open .kodza-make-way__label-inner {
  transform: translateY(-100%);
  transition: transform calc(0.22s * var(--kz-motion-scale, 1)) cubic-bezier(0.65, 0, 0.35, 1);
}

.kodza-make-way__close {
  position: absolute;
  top: var(--kz-make-way-pad);
  right: var(--kz-make-way-pad);
  width: 36px;
  height: 36px;
  border-radius: var(--kz-radius-pill, 999px);
  background: var(--kz-make-way-pill-bg);
  opacity: 0;
  transform: scale(0.6) rotate(-45deg);
  transition:
    opacity calc(0.18s * var(--kz-motion-scale, 1)) ease,
    transform calc(0.18s * var(--kz-motion-scale, 1)) cubic-bezier(0.65, 0, 0.35, 1);
}

.kodza-make-way__close::before,
.kodza-make-way__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  margin: -0.75px 0 0 -7px;
  background: var(--kz-make-way-pill-fg);
  transform: rotate(45deg);
}

.kodza-make-way__close::after {
  transform: rotate(-45deg);
}

.kodza-make-way__item.is-open .kodza-make-way__close {
  opacity: 1;
  transform: none;
  transition:
    opacity calc(0.3s * var(--kz-motion-scale, 1)) ease calc(0.4s * var(--kz-motion-scale, 1)),
    transform calc(0.4s * var(--kz-motion-scale, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(0.4s * var(--kz-motion-scale, 1));
}

/* The card, as wide as it will be once open. Closed, it is folded down to the pill's shape
   (--kz-make-way-fold, measured by the script) and unfolds from it */
.kodza-make-way__details {
  position: absolute;
  bottom: var(--kz-make-way-pad);
  left: var(--kz-make-way-pad);
  width: min(var(--kz-make-way-card), var(--kz-make-way-across) * var(--kz-make-way-col) + (var(--kz-make-way-across) - 1) * var(--kz-make-way-gap) - 2 * var(--kz-make-way-pad));
  padding: 20px 22px 22px;
  box-sizing: border-box;
  border-radius: var(--kz-make-way-card-radius);
  background: var(--kz-make-way-pill-bg);
  color: var(--kz-make-way-pill-fg);
  clip-path: var(--kz-make-way-fold, inset(100% 100% 0 0));
  visibility: hidden;
  pointer-events: none;
  transition:
    clip-path calc(0.3s * var(--kz-motion-scale, 1)) cubic-bezier(0.65, 0, 0.35, 1) calc(0.1s * var(--kz-motion-scale, 1)),
    visibility 0s linear calc(0.4s * var(--kz-motion-scale, 1));
}

.kodza-make-way__item.is-open .kodza-make-way__details {
  clip-path: inset(0 round var(--kz-make-way-card-radius));
  visibility: visible;
  pointer-events: auto;
  transition:
    clip-path calc(0.55s * var(--kz-motion-scale, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(0.2s * var(--kz-motion-scale, 1)),
    visibility 0s linear calc(0.2s * var(--kz-motion-scale, 1));
}

.kodza-make-way__title {
  margin: 0 0 6px;
  color: inherit;
  font-family: var(--kz-font-display, inherit);
  font-size: calc(24px * var(--kz-font-display-scale, 1));
  font-weight: var(--kz-font-display-weight, 600);
  letter-spacing: var(--kz-font-display-tracking, -0.035em);
  text-transform: var(--kz-font-display-case, inherit);
  line-height: 1.15;
}

.kodza-make-way__meta {
  margin: 0 0 12px;
  color: var(--kz-make-way-muted);
  font-family: var(--kz-font-label, var(--kz-font-mono, ui-monospace, "SF Mono", Menlo, monospace));
  font-size: var(--kz-font-label-size, 12px);
  font-weight: var(--kz-font-label-weight, inherit);
  letter-spacing: var(--kz-font-label-tracking, inherit);
  line-height: var(--kz-font-label-leading, 1.4);
}

.kodza-make-way__text {
  margin: 0;
  color: var(--kz-make-way-muted);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Each line rises from behind its own mask once the card has unfolded */
.kodza-make-way__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.kodza-make-way__line > span {
  display: block;
  transform: translateY(110%);
  transition: transform calc(0.18s * var(--kz-motion-scale, 1)) cubic-bezier(0.65, 0, 0.35, 1);
}

.kodza-make-way__item.is-open .kodza-make-way__line > span {
  transform: none;
  transition: transform calc(0.6s * var(--kz-motion-scale, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc((0.32s + var(--kz-line, 0) * 0.06s) * var(--kz-motion-scale, 1));
}

@container kodza-make-way (max-width: 559px) {
  .kodza-make-way__grid {
    --kz-make-way-cols: var(--kz-make-way-columns-small);
    --kz-make-way-rows: var(--kz-make-way-ratio-small);
    --kz-make-way-pad: var(--kz-make-way-inset-small);
  }

  .kodza-make-way__index {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kodza-make-way__label,
  .kodza-make-way__label-inner,
  .kodza-make-way__close,
  .kodza-make-way__details,
  .kodza-make-way__line > span {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* Theming example — on a dark background:
.dark-section .kodza-make-way {
  --kz-make-way-bg: #1c1c1c;
  --kz-make-way-pill-bg: #161616;
  --kz-make-way-pill-fg: #f2f2f0;
  --kz-make-way-muted: rgba(242, 242, 240, 0.62);
  --kz-make-way-focus: #f2f2f0;
}
*/

/* kodza-guard 0f24fcc1b551 — generated by Kodza, do not edit.
   Theme guard: keeps a site's own CSS (WordPress themes, Bootstrap, CSS resets…) off this
   component. :not(#_) is always true and weighs as much as an id, so these lines win over
   theme rules made of classes and tags. Customise the component through its --kz-* variables. */

/* What the browser gives, where the component sets it only in some states: at the lowest weight, so its own rules below put it back */

:where(.kodza-make-way__toggle):not(#_) {
  outline: revert;
}

/* What the browser gives, on everything the component leaves to it */

.kodza-make-way:not(#_),
.kodza-make-way__frame:not(#_),
.kodza-make-way__label-inner:not(#_),
.kodza-make-way__index:not(#_),
.kodza-make-way__name:not(#_),
.kodza-make-way__close:not(#_),
.kodza-make-way__line:not(#_),
.kodza-make-way__line span:where(:not([class*="kodza-"])):not(#_) {
  box-sizing: revert;
}

.kodza-make-way__grid:not(#_) {
  border: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-make-way__item:not(#_) {
  border: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-make-way__image:not(#_) {
  border: revert;
  margin: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-make-way__toggle:not(#_) {
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
  white-space: revert;
  min-height: revert;
}

.kodza-make-way__title:not(#_) {
  border: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  font-style: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-make-way__meta:not(#_) {
  border: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  font-style: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-make-way__text:not(#_) {
  border: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  font-family: revert;
  font-weight: revert;
  font-style: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-make-way__item:not(#_):where(:not([hidden])),
.kodza-make-way__title:not(#_):where(:not([hidden])),
.kodza-make-way__meta:not(#_):where(:not([hidden])),
.kodza-make-way__text:not(#_):where(:not([hidden])) {
  display: revert;
}

.kodza-make-way__item:not(#_):where([hidden]),
.kodza-make-way__title:not(#_):where([hidden]),
.kodza-make-way__meta:not(#_):where([hidden]),
.kodza-make-way__text:not(#_):where([hidden]) {
  display: none;
}

.kodza-make-way__frame:not(#_)::after,
.kodza-make-way__close:not(#_)::before,
.kodza-make-way__close:not(#_)::after {
  box-sizing: revert;
}

/* The component's own rules, one step stronger: real buttons and fields, what it sets on tags themes style (links, lists, headings, images…), and the root width (a theme may narrow it, never widen it) */

.kodza-make-way__grid:not(#_) {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kodza-make-way__item:not(#_) {
  position: relative;
  margin: 0;
  padding: 0;
}

.kodza-make-way__image:not(#_) {
  display: block;
  max-width: none;
  transition: transform calc(0.9s * var(--kz-motion-scale, 1)) cubic-bezier(0.22, 1, 0.36, 1);
}

.kodza-make-way__toggle:not(#_) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.kodza-make-way__toggle:focus-visible:not(#_) {
  outline: none;
}

.kodza-make-way__title:not(#_) {
  margin: 0 0 6px;
  color: inherit;
  font-family: var(--kz-font-display, inherit);
  font-size: calc(24px * var(--kz-font-display-scale, 1));
  font-weight: var(--kz-font-display-weight, 600);
  letter-spacing: var(--kz-font-display-tracking, -0.035em);
  text-transform: var(--kz-font-display-case, inherit);
  line-height: 1.15;
}

.kodza-make-way__meta:not(#_) {
  margin: 0 0 12px;
  color: var(--kz-make-way-muted);
  font-family: var(--kz-font-label, var(--kz-font-mono, ui-monospace, "SF Mono", Menlo, monospace));
  font-size: var(--kz-font-label-size, 12px);
  font-weight: var(--kz-font-label-weight, inherit);
  letter-spacing: var(--kz-font-label-tracking, inherit);
  line-height: var(--kz-font-label-leading, 1.4);
}

.kodza-make-way__text:not(#_) {
  margin: 0;
  color: var(--kz-make-way-muted);
  font-size: 15px;
  line-height: 1.55;
}
```

```js
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Kodza — Make Way Grid
// Opens one picture at a time: it takes two by two cells, the others slide out of its way
// (measured before and after, then animated from where they were), and its card unfolds from
// the name pill. Each card text is cut into lines at the card's width, so it rises line by line.
// Tune it with the --kz-make-way-* variables in the CSS and the constants below.
(() => {
  const SELECTOR = '.kodza-make-way';
  const MOVE = 700; // ms, the pictures sliding to their new cells; the card unfolds while they move (CSS)
  const MOVE_EASE = 'cubic-bezier(0.76, 0, 0.24, 1)';
  const CAUGHT_EASE = 'cubic-bezier(0.33, 0.66, 0.4, 1)'; // a move caught mid-way goes on at speed, no stop
  const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
  // The site's pace, --kz-motion-scale (set on :root, read on the instance): every duration of the
  // script times it, and 0 moves nothing, like reduced motion
  const paceOf = (el) => {
    const pace = parseFloat(getComputedStyle(el).getPropertyValue('--kz-motion-scale'));
    return pace >= 0 ? pace : 1;
  };

  // One instance, with its own state: two copies on a page never interfere. Everything it
  // starts is tied to `signal` (listeners get { signal }, observers and timers stop on its
  // 'abort' event), so kodza:destroy stops it all.
  function mount(root, signal) {
    const pace = paceOf(root);
    const still = reduceMotion || !pace; // the still path: no motion asked, by the visitor or the site
    const grid = root.querySelector('.kodza-make-way__grid');
    const items = grid ? [...grid.children].filter((el) => el.matches('.kodza-make-way__item')) : [];
    const frames = items.map((item) => item.querySelector('.kodza-make-way__frame'));
    const toggles = items.map((item) => item.querySelector('.kodza-make-way__toggle'));
    const pills = items.map((item) => item.querySelector('.kodza-make-way__label'));
    const cards = items.map((item) => item.querySelector('.kodza-make-way__details'));
    if (!items.length || [...frames, ...toggles, ...pills, ...cards].some((el) => !el)) return;

    // Plain text only: a title or paragraph with links or markup just shows with its card
    const texts = cards.map((card) => [...card.querySelectorAll('.kodza-make-way__title, .kodza-make-way__meta, .kodza-make-way__text')]
      .filter((el) => !el.children.length)
      .map((el) => ({ el, words: el.textContent.trim().split(/[^\S ]+/) })));

    // Cuts a text into masked lines; the line count runs on from `first` across a card's texts
    const split = (el, words, first) => {
      el.textContent = '';
      const spans = words.map((word) => {
        const span = document.createElement('span');
        span.textContent = `${word} `;
        el.append(span);
        return span;
      });
      const lines = [];
      spans.forEach((span) => {
        const last = lines[lines.length - 1];
        if (last && last.top === span.offsetTop) last.words.push(span.textContent);
        else lines.push({ top: span.offsetTop, words: [span.textContent] });
      });
      el.textContent = '';
      lines.forEach((line, i) => {
        const outer = document.createElement('span');
        const inner = document.createElement('span');
        outer.className = 'kodza-make-way__line';
        inner.textContent = line.words.join('').trim();
        inner.style.setProperty('--kz-line', first + i);
        outer.append(inner);
        el.append(outer, ' ');
      });
      return first + lines.length;
    };

    // Lines at the card's width, and each card folded down to its pill (same corner, same size)
    let measured = -1;
    const layout = () => {
      const width = cards[0].offsetWidth;
      if (width !== measured) {
        measured = width;
        texts.forEach((list) => list.reduce((first, { el, words }) => split(el, words, first), 0));
      }
      cards.forEach((card, i) => {
        const pill = pills[i];
        const round = Math.min(parseFloat(getComputedStyle(pill).borderTopLeftRadius) || 0, pill.offsetHeight / 2);
        card.style.setProperty('--kz-make-way-fold', `inset(${card.offsetHeight - pill.offsetHeight}px ${card.offsetWidth - pill.offsetWidth}px 0px 0px round ${round}px)`);
      });
    };

    // The open picture keeps its row and takes the cells on its free side; the others flow
    // around it in order
    let current = -1;
    const spanOf = () => Math.max(1, parseInt(getComputedStyle(root).getPropertyValue('--kz-make-way-span'), 10) || 2);
    const place = () => {
      const cols = getComputedStyle(grid).gridTemplateColumns.split(' ').length;
      const span = spanOf();
      const across = Math.min(span, cols);
      items.forEach((item, i) => {
        const open = i === current;
        item.style.gridColumn = open ? `${Math.min(i % cols, cols - across) + 1} / span ${across}` : '';
        item.style.gridRow = open ? `${Math.floor(i / cols) + 1} / span ${span}` : '';
      });
    };

    // The engine moves the pictures: they slide and grow from their old cells to their new ones
    const engine = makeWay(grid, frames, { duration: MOVE * pace, easing: MOVE_EASE, caught: CAUGHT_EASE });
    let generation = 0;
    const go = (next) => {
      const leaving = items[current];
      const change = () => {
        items.forEach((item, i) => {
          item.classList.toggle('is-open', i === next);
          item.classList.remove('is-leaving');
          toggles[i].setAttribute('aria-expanded', String(i === next));
        });
        current = next;
        place();
      };
      if (still) return change();
      const run = ++generation;
      engine.move(change).then(() => run === generation && leaving?.classList.remove('is-leaving'));
      if (leaving) leaving.classList.add('is-leaving');
    };

    toggles.forEach((toggle, i) => toggle.addEventListener('click', () => go(i === current ? -1 : i), { signal }));

    // Escape closes and gives the focus back; the arrows move along the pictures, and open the
    // next one when one is open
    root.addEventListener('keydown', (event) => {
      if (event.key === 'Escape' && current >= 0) {
        const toggle = toggles[current];
        go(-1);
        toggle.focus();
        return;
      }
      const at = toggles.indexOf(event.target);
      const to = at < 0 ? undefined : { ArrowLeft: at - 1, ArrowRight: at + 1, Home: 0, End: toggles.length - 1 }[event.key];
      if (to === undefined) return;
      event.preventDefault();
      const next = (to + toggles.length) % toggles.length;
      toggles[next].focus();
      if (current >= 0) go(next);
    }, { signal });

    // Written open in the markup: it starts open
    const first = items.findIndex((item) => item.classList.contains('is-open'));
    items.forEach((item, i) => {
      item.classList.toggle('is-open', i === first);
      toggles[i].setAttribute('aria-expanded', String(i === first));
    });
    current = first;
    place();
    layout();

    // A new width can change the column count and the card's lines
    let width = grid.clientWidth;
    let raf = 0;
    const observer = new ResizeObserver(() => {
      if (grid.clientWidth === width) return;
      width = grid.clientWidth;
      cancelAnimationFrame(raf);
      raf = requestAnimationFrame(() => {
        engine.cancel();
        place();
        layout();
      });
    });
    observer.observe(root);
    document.fonts?.ready.then(() => {
      if (signal.aborted) return;
      measured = -1;
      layout();
    });
    signal.addEventListener('abort', () => {
      observer.disconnect();
      cancelAnimationFrame(raf);
      engine.cancel();
    });
  }

  // ---------- Make Way engine (copied as is by Expanding Panels) ----------
  // move(change) measures every frame in the container's own pixels (a parent scaled by
  // transform does not shift them), runs change() to give them their new places, measures again,
  // then slides and resizes each frame from where it was to where it is. Caught mid-move, a frame
  // starts again from where it is. The container's height follows, so the page below never
  // jumps. A frame clips its picture (object-fit: cover): the picture grows with it, never stretched.
  // timing: { duration, easing, caught } — caught, the easing of a move that starts mid-way.
  function makeWay(container, frames, { duration, easing, caught = easing }) {
    let moving = [];
    const rects = () => {
      const box = container.getBoundingClientRect();
      const scale = box.width / container.offsetWidth || 1;
      return frames.map((frame) => {
        const rect = frame.getBoundingClientRect();
        return { x: (rect.left - box.left) / scale, y: (rect.top - box.top) / scale, w: rect.width / scale, h: rect.height / scale };
      });
    };
    const cancel = () => {
      moving.forEach((animation) => animation.cancel());
      moving = [];
    };
    const move = (change) => {
      const before = rects();
      const tall = container.offsetHeight;
      const timing = { duration, easing: moving.some((a) => a.playState === 'running') ? caught : easing };
      cancel();
      change();
      const after = rects();
      frames.forEach((frame, i) => {
        const [a, b] = [before[i], after[i]];
        if (Math.max(Math.abs(a.x - b.x), Math.abs(a.y - b.y), Math.abs(a.w - b.w), Math.abs(a.h - b.h)) < 0.5) return;
        moving.push(frame.animate([
          { transform: `translate(${a.x - b.x}px, ${a.y - b.y}px)`, width: `${a.w}px`, height: `${a.h}px` },
          { transform: 'translate(0px, 0px)', width: `${b.w}px`, height: `${b.h}px` },
        ], timing));
      });
      const height = container.offsetHeight;
      if (height !== tall) moving.push(container.animate([{ height: `${tall}px` }, { height: `${height}px` }], timing));
      // Resolves once everything has arrived, false when a newer move or a cancel cut it short
      return Promise.all(moving.map((animation) => animation.finished)).then(() => true, () => false);
    };
    return { move, cancel };
  }
  // ---------- end of the engine ----------

  // Kodza lifecycle, the same in every component: `kodza:init` starts the instances inside
  // event.detail.root (the whole page by default), `kodza:destroy` stops them and puts their
  // markup back. For themes and apps that swap content without a page load. Each running root
  // keeps its markup as written under KODZA, shared by every Kodza script on the page: a Kodza
  // component inside another one is saved as written, not half-started, and stopped with it. Two
  // components on one root (a reveal on a stat card) both start, and stop together.
  const KODZA = Symbol.for('kodza');
  const RUNNING = Symbol.for(`kodza ${SELECTOR}`); // a root this component runs on, for every copy of this script
  const instances = new WeakMap();
  const find = (scope = document) => [scope, ...scope.querySelectorAll(SELECTOR)].filter((el) => el.matches?.(SELECTOR));
  const attrsOf = (el) => [...el.attributes].map((a) => [a.name, a.value]);
  const put = (el, saved) => {
    [...el.attributes].forEach((a) => el.removeAttribute(a.name));
    saved.attrs.forEach(([name, value]) => el.setAttribute(name, value));
    el.innerHTML = saved.html;
  };
  // The markup inside a root as written: Kodza components already running in it give back their own
  const written = (root) => {
    const all = [...root.querySelectorAll('*')];
    if (!all.some((el) => el[KODZA])) return root.innerHTML;
    const copy = root.cloneNode(true);
    const twins = copy.querySelectorAll('*');
    let last = null;
    all.forEach((el, i) => {
      if (!el[KODZA] || last?.contains(el)) return;
      last = el;
      put(twins[i], el[KODZA]);
    });
    return copy.innerHTML;
  };
  const init = (scope) => find(scope).forEach((root) => {
    // Already running, maybe from another copy of this script. Marked is-ready with no Kodza component
    // running on it, a root is a copy of a started one (a cloned slide): it is left as it is
    if (root[RUNNING] || (root.classList.contains('is-ready') && !root[KODZA])) return;
    // Rendered by React (data-kodza-manual): React starts it, with an init aimed at that markup once
    // it has hydrated it. Any earlier start would change markup React has not taken over yet
    const owner = root.closest('[data-kodza-manual]');
    if (owner && !(scope && owner.contains(scope))) return;
    const controller = new AbortController();
    // Another Kodza component already running on this root: its markup as written is kept, and the
    // two stop together
    const before = root[KODZA];
    const saved = { html: before ? before.html : written(root), attrs: before ? before.attrs : attrsOf(root), stop: () => destroy(root) };
    if (before) before.above = saved;
    instances.set(root, { controller, saved, before });
    root[KODZA] = saved;
    root[RUNNING] = true;
    mount(root, controller.signal);
    root.classList.add('is-ready');
  });
  const destroy = (scope) => find(scope).forEach((root) => {
    const instance = instances.get(root);
    if (!instance) return;
    instances.delete(root);
    instance.saved.above?.stop(); // a Kodza component started after it on the same root stops first
    // The Kodza components running inside it stop first: once its markup is put back, their own
    // script could not find them any more
    root.querySelectorAll('*').forEach((el) => el[KODZA]?.stop());
    instance.controller.abort();
    delete root[RUNNING];
    // Started on top of another one: that one stops next, and puts the markup back
    if (instance.before) {
      delete instance.before.above;
      root[KODZA] = instance.before;
      return instance.before.stop();
    }
    delete root[KODZA];
    put(root, instance.saved);
  });
  document.addEventListener('kodza:init', (event) => init(event.detail?.root));
  document.addEventListener('kodza:destroy', (event) => destroy(event.detail?.root));
  init();
  // Loaded in <head>, the script runs before the markup exists: once more when it is parsed
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', () => init(), { once: true });
})();
```

Free to use, from Kodza (https://kodza.dev).
