# Hero Screen

> A centred title and its buttons over a screenshot of the product, leaning back in perspective. On scroll the screen stands up to face you and grows while the title steps back.

Hero · hero, section, landing, saas, screenshot, product, perspective, 3d, scroll, sticky, scrub · HTML, CSS, vanilla JS · no dependencies · updated 2026-10-23
Demo: https://kodza.dev/components/hero-screen/

Takes the whole screen (or reacts to the page scroll): give it a page, not a small box.

## Files

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

- [`kodza-hero-screen.css`](https://kodza.dev/registry/hero-screen/kodza-hero-screen.css) · 18.0 KB
- [`kodza-hero-screen.js`](https://kodza.dev/registry/hero-screen/kodza-hero-screen.js) · 12.5 KB
- [`kodza-hero-screen.html`](https://kodza.dev/registry/hero-screen/kodza-hero-screen.html) · 2.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-hero-screen.css https://kodza.dev/registry/hero-screen/kodza-hero-screen.css
curl -fsSL --create-dirs -o kodza/kodza-hero-screen.js https://kodza.dev/registry/hero-screen/kodza-hero-screen.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`.)

## API

- Root: `.kodza-hero-screen`
- Variables (set them on the root element itself: it declares its own defaults):
  - `--kz-hero-screen-ink: #0a0a0a`
  - `--kz-hero-screen-paper: #f2f2f0`
  - `--kz-hero-screen-dim: rgba(10, 10, 10, 0.62)`
  - `--kz-hero-screen-faint: rgba(10, 10, 10, 0.6)`
  - `--kz-hero-screen-soft: rgba(10, 10, 10, 0.07)`
  - `--kz-hero-screen-bg: transparent`
  - `--kz-hero-screen-bezel: #fff` — the frame around the screenshot
  - `--kz-hero-screen-edge: rgba(10, 10, 10, 0.1)`
  - `--kz-hero-screen-shadow-far: 0 60px 110px -34px rgba(10, 10, 10, 0.34), 0 24px 48px -24px rgba(10, 10, 10, 0.16)` — leaning back
  - `--kz-hero-screen-shadow-near: 0 1px 2px rgba(10, 10, 10, 0.06), 0 22px 48px -22px rgba(10, 10, 10, 0.24)` — upright
  - `--kz-hero-screen-veil: linear-gradient(rgba(10, 10, 10, 0.14), rgba(10, 10, 10, 0.03) 70%)` — the shade on the screen while it leans
  - `--kz-hero-screen-width: 1240px`
  - `--kz-hero-screen-gutter: clamp(16px, 4vw, 40px)`
  - `--kz-hero-screen-pad-y: clamp(20px, 3svh, 40px)`
  - `--kz-hero-screen-size: clamp(36px, min(6.4cqi, 9.4svh), 96px)` — the title lines
  - `--kz-hero-screen-ratio: 1.6` — the screenshot's width / height
  - `--kz-hero-screen-tilt: 24deg` — how far the screen leans back at rest
  - `--kz-hero-screen-shrink: 0.86` — its scale at rest: it grows to full size
  - `--kz-hero-screen-depth: 1600px` — the perspective: shorter is stronger
  - `--kz-hero-screen-radius: 18px`
  - `--kz-hero-screen-top: 0px` — height of a fixed site header: the scene pins under it
  - `--kz-hero-screen-distance: 140svh` — how long the scene holds
  - `--kz-hero-screen-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace`
  - `--kz-hero-screen-ease: cubic-bezier(0.22, 1, 0.36, 1)`
- 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 button (focus in `.kodza-hero-screen__button`):
  - `Enter`: Follows the link
- Tabbing back in:
  - `Shift+Tab`: Lands on a button, the hero scrolls back to show it whole

## 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-hero-screen {
    --kz-hero-screen-ink: #f2f2f0;
    --kz-hero-screen-paper: #0a0a0a;
    --kz-hero-screen-dim: rgba(242, 242, 240, 0.64);
    --kz-hero-screen-faint: rgba(242, 242, 240, 0.5);
    --kz-hero-screen-soft: rgba(242, 242, 240, 0.1);
    --kz-hero-screen-bezel: #161616;
    --kz-hero-screen-edge: rgba(255, 255, 255, 0.12);
    --kz-hero-screen-shadow-far: 0 60px 110px -34px rgba(0, 0, 0, 0.7), 0 24px 48px -24px rgba(0, 0, 0, 0.5);
    --kz-hero-screen-shadow-near: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 48px -22px rgba(0, 0, 0, 0.6);
    --kz-hero-screen-veil: linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.08) 70%);
  }
}
```

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

Its images have dark versions next to them (`kz-grid-2400.webp` → `kz-grid-dark-2400.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-hero-screen.css` next to the page (the Files commands as they are), linked in `<head>`: `<link rel="stylesheet" href="kodza/kodza-hero-screen.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-hero-screen.js`, loaded with `<script src="kodza/kodza-hero-screen.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. 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">`.
- 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-hero-screen.css' -e 'd' -e '}' -e '/^KODZA-JS$/{r kodza/kodza-hero-screen.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">`.
- 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.
- This one spans the page: a block theme keeps a Custom HTML block to the width of the text column, so put it inside a **Group** block set to **Full width**, with **Inner blocks use content width** turned off.
- 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-hero-screen', $uri . 'kodza-hero-screen.css', [], filemtime($dir . 'kodza-hero-screen.css'));
    wp_enqueue_script('kodza-hero-screen', $uri . 'kodza-hero-screen.js', [], filemtime($dir . 'kodza-hero-screen.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.
- This one spans the page: give the widget its own container, **Content Width: Full Width**, padding 0.
- 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-hero-screen.css` and `assets/kodza-hero-screen.js` (the Files commands with `-o assets/…`).
- In the section: `{{ 'kodza-hero-screen.css' | asset_url | stylesheet_tag }}` and `<script src="{{ 'kodza-hero-screen.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/`): `HeroScreen.tsx` (below), the CSS block under Code saved as `hero-screen.css` and the JS block as `hero-screen.js`, both as they are. The HTML block is already inside the component: skip it.
- Use it: `import { HeroScreen } from '@/components/kodza/HeroScreen';` then `<HeroScreen />`. Props: `vars` (the `--kz-…` variables listed under API, e.g. `vars={{ '--kz-hero-screen-ink': … }}`), `className`, `style` and the other props of its `<section>` (`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 './hero-screen.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.

```tsx
'use client';
// Kodza — Hero Screen, for React. From https://kodza.dev/components/hero-screen/
// 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: hero-screen.css and hero-screen.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.
import { useRef, useEffect, type ComponentPropsWithoutRef, type ComponentRef, type CSSProperties } from 'react';
import './hero-screen.css';

export type HeroScreenProps = Omit<ComponentPropsWithoutRef<'section'>, "children" | "vars"> & {
  /** Settings, as CSS variables on the root */
  vars?: {
    /** default: #0a0a0a */
    "--kz-hero-screen-ink"?: string | number;
    /** default: #f2f2f0 */
    "--kz-hero-screen-paper"?: string | number;
    /** default: rgba(10, 10, 10, 0.62) */
    "--kz-hero-screen-dim"?: string | number;
    /** default: rgba(10, 10, 10, 0.6) */
    "--kz-hero-screen-faint"?: string | number;
    /** default: rgba(10, 10, 10, 0.07) */
    "--kz-hero-screen-soft"?: string | number;
    /** default: transparent */
    "--kz-hero-screen-bg"?: string | number;
    /** the frame around the screenshot — default: #fff */
    "--kz-hero-screen-bezel"?: string | number;
    /** default: rgba(10, 10, 10, 0.1) */
    "--kz-hero-screen-edge"?: string | number;
    /** leaning back — default: 0 60px 110px -34px rgba(10, 10, 10, 0.34), 0 24px 48px -24px rgba(10, 10, 10, 0.16) */
    "--kz-hero-screen-shadow-far"?: string | number;
    /** upright — default: 0 1px 2px rgba(10, 10, 10, 0.06), 0 22px 48px -22px rgba(10, 10, 10, 0.24) */
    "--kz-hero-screen-shadow-near"?: string | number;
    /** the shade on the screen while it leans — default: linear-gradient(rgba(10, 10, 10, 0.14), rgba(10, 10, 10, 0.03) 70%) */
    "--kz-hero-screen-veil"?: string | number;
    /** default: 1240px */
    "--kz-hero-screen-width"?: string | number;
    /** default: clamp(16px, 4vw, 40px) */
    "--kz-hero-screen-gutter"?: string | number;
    /** default: clamp(20px, 3svh, 40px) */
    "--kz-hero-screen-pad-y"?: string | number;
    /** the title lines — default: clamp(36px, min(6.4cqi, 9.4svh), 96px) */
    "--kz-hero-screen-size"?: string | number;
    /** the screenshot's width / height — default: 1.6 */
    "--kz-hero-screen-ratio"?: string | number;
    /** how far the screen leans back at rest — default: 24deg */
    "--kz-hero-screen-tilt"?: string | number;
    /** its scale at rest: it grows to full size — default: 0.86 */
    "--kz-hero-screen-shrink"?: string | number;
    /** the perspective: shorter is stronger — default: 1600px */
    "--kz-hero-screen-depth"?: string | number;
    /** default: 18px */
    "--kz-hero-screen-radius"?: string | number;
    /** height of a fixed site header: the scene pins under it — default: 0px */
    "--kz-hero-screen-top"?: string | number;
    /** how long the scene holds — default: 140svh */
    "--kz-hero-screen-distance"?: string | number;
    /** default: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace */
    "--kz-hero-screen-mono"?: string | number;
    /** default: cubic-bezier(0.22, 1, 0.36, 1) */
    "--kz-hero-screen-ease"?: string | number;
  };
  className?: string;
};

export function HeroScreen({ vars, className, style, ...rest }: HeroScreenProps) {
  const ref = useRef<ComponentRef<'section'>>(null);
  const classes = ["kodza-hero-screen", 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('./hero-screen.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 (
    <section key={key} {...rest} className={classes} style={{ ...vars, ...style } as CSSProperties} ref={ref}>
      <div className="kodza-hero-screen__scene">
        <div className="kodza-hero-screen__copy">
          <p className="kodza-hero-screen__eyebrow">
            <span className="kodza-hero-screen__rise">v2.4 is out · shipped on a Tuesday</span>
          </p>
          <h1 className="kodza-hero-screen__title">
            <span className="kodza-hero-screen__line">
              <span className="kodza-hero-screen__rise">Show the product.</span>
            </span>
            {' '}
            <span className="kodza-hero-screen__line">
              <span className="kodza-hero-screen__rise">Skip the pitch.</span>
            </span>
          </h1>
          <div className="kodza-hero-screen__foot">
            <p className="kodza-hero-screen__lead">Your real screen, not a Dribbble shot. It leans back, then stands up as they scroll.</p>
            <div className="kodza-hero-screen__actions">
              <a className="kodza-hero-screen__button kodza-hero-screen__button--ink" href="#">Try it, no card<svg className="kodza-hero-screen__arrow" viewBox="0 0 16 16" aria-hidden="true"> <path d="M2.5 8h10.5M9 3.5 13.5 8 9 12.5" /> </svg></a>
              {' '}
              <a className="kodza-hero-screen__button kodza-hero-screen__button--soft" href="#">What's new</a>
            </div>
          </div>
        </div>
        <div className="kodza-hero-screen__stage">
          <div className="kodza-hero-screen__device">
            <div className="kodza-hero-screen__tilt">
              <div className="kodza-hero-screen__shadows" aria-hidden="true">
                <div className="kodza-hero-screen__shadow kodza-hero-screen__shadow--far" />
                <div className="kodza-hero-screen__shadow kodza-hero-screen__shadow--near" />
              </div>
              <div className="kodza-hero-screen__curtain">
                <div className="kodza-hero-screen__hold">
                  <div className="kodza-hero-screen__frame">
                    <div className="kodza-hero-screen__glass">
                      <img src="https://kodza.dev/media/kz-grid-2400.webp" alt="The Kodza catalogue: a search field, category filters and a grid of component previews" width="2400" height="1500" />
                    </div>
                    <div className="kodza-hero-screen__veil" />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}
```

## Code

```html
<section class="kodza-hero-screen">
  <div class="kodza-hero-screen__scene">
    <div class="kodza-hero-screen__copy">
      <p class="kodza-hero-screen__eyebrow"><span class="kodza-hero-screen__rise">v2.4 is out · shipped on a Tuesday</span></p>
      <h1 class="kodza-hero-screen__title"><span class="kodza-hero-screen__line"><span class="kodza-hero-screen__rise">Show the product.</span></span> <span class="kodza-hero-screen__line"><span class="kodza-hero-screen__rise">Skip the pitch.</span></span></h1>
      <div class="kodza-hero-screen__foot">
        <p class="kodza-hero-screen__lead">Your real screen, not a Dribbble shot. It leans back, then stands up as they scroll.</p>
        <div class="kodza-hero-screen__actions">
          <a class="kodza-hero-screen__button kodza-hero-screen__button--ink" href="#">Try it, no card<svg class="kodza-hero-screen__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 8h10.5M9 3.5 13.5 8 9 12.5" /></svg></a>
          <a class="kodza-hero-screen__button kodza-hero-screen__button--soft" href="#">What's new</a>
        </div>
      </div>
    </div>
    <div class="kodza-hero-screen__stage">
      <div class="kodza-hero-screen__device">
        <div class="kodza-hero-screen__tilt">
          <div class="kodza-hero-screen__shadows" aria-hidden="true"><div class="kodza-hero-screen__shadow kodza-hero-screen__shadow--far"></div><div class="kodza-hero-screen__shadow kodza-hero-screen__shadow--near"></div></div>
          <div class="kodza-hero-screen__curtain">
            <div class="kodza-hero-screen__hold">
              <div class="kodza-hero-screen__frame">
                <div class="kodza-hero-screen__glass"><img src="https://kodza.dev/media/kz-grid-2400.webp" alt="The Kodza catalogue: a search field, category filters and a grid of component previews" width="2400" height="1500" /></div>
                <div class="kodza-hero-screen__veil"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
```

```css
/* Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license */
/* Kodza — Hero Screen
   A centred title and its buttons over a screenshot of the product, leaning back in
   perspective. On scroll the scene holds while the screen stands up to face you and grows to its
   real size, passing over the title as it steps back: leaning, the screen sits in shade under a
   long soft shadow; upright, it lights up and the shadow tucks in. Then the page goes on.
   Without the script, or with reduced motion, nothing pins: the title, then the screen, upright.
   Everything is tuned with the --kz-hero-screen-* variables. */
.kodza-hero-screen {
  --kz-hero-screen-ink: #0a0a0a;
  --kz-hero-screen-paper: #f2f2f0;
  --kz-hero-screen-dim: rgba(10, 10, 10, 0.62);
  --kz-hero-screen-faint: rgba(10, 10, 10, 0.6);
  --kz-hero-screen-soft: rgba(10, 10, 10, 0.07);
  --kz-hero-screen-bg: transparent;
  --kz-hero-screen-bezel: #fff; /* the frame around the screenshot */
  --kz-hero-screen-edge: rgba(10, 10, 10, 0.1);
  --kz-hero-screen-shadow-far: 0 60px 110px -34px rgba(10, 10, 10, 0.34), 0 24px 48px -24px rgba(10, 10, 10, 0.16); /* leaning back */
  --kz-hero-screen-shadow-near: 0 1px 2px rgba(10, 10, 10, 0.06), 0 22px 48px -22px rgba(10, 10, 10, 0.24); /* upright */
  --kz-hero-screen-veil: linear-gradient(rgba(10, 10, 10, 0.14), rgba(10, 10, 10, 0.03) 70%); /* the shade on the screen while it leans */
  --kz-hero-screen-width: 1240px;
  --kz-hero-screen-gutter: clamp(16px, 4vw, 40px);
  --kz-hero-screen-pad-y: clamp(20px, 3svh, 40px);
  --kz-hero-screen-size: clamp(36px, min(6.4cqi, 9.4svh), 96px); /* the title lines */
  --kz-hero-screen-ratio: 1.6; /* the screenshot's width / height */
  --kz-hero-screen-tilt: 24deg; /* how far the screen leans back at rest */
  --kz-hero-screen-shrink: 0.86; /* its scale at rest: it grows to full size */
  --kz-hero-screen-depth: 1600px; /* the perspective: shorter is stronger */
  --kz-hero-screen-radius: 18px;
  --kz-hero-screen-top: 0px; /* height of a fixed site header: the scene pins under it */
  --kz-hero-screen-distance: 140svh; /* how long the scene holds */
  --kz-hero-screen-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --kz-hero-screen-ease: cubic-bezier(0.22, 1, 0.36, 1);
  container: kodza-hero-screen / inline-size;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  color: var(--kz-hero-screen-ink);
}

.kodza-hero-screen__scene {
  position: relative;
  background: var(--kz-hero-screen-bg);
}

.kodza-hero-screen__copy {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(var(--kz-hero-screen-width) + 2 * var(--kz-hero-screen-gutter));
  margin: 0 auto;
  padding: clamp(72px, 9vw, 140px) max(var(--kz-hero-screen-gutter), env(safe-area-inset-right, 0px)) clamp(44px, 5vw, 72px) max(var(--kz-hero-screen-gutter), env(safe-area-inset-left, 0px));
  text-align: center;
  transform-origin: 50% 0;
}

.kodza-hero-screen__eyebrow {
  overflow: hidden;
  margin: 0 0 clamp(16px, 2cqi, 26px);
  font-family: var(--kz-hero-screen-mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--kz-hero-screen-faint);
}

.kodza-hero-screen__rise {
  display: block;
}

.kodza-hero-screen__title {
  margin: 0 0 clamp(20px, 2.4cqi, 30px);
  font-size: var(--kz-hero-screen-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}

/* Each line is a mask: the words rise out of it on arrival */
.kodza-hero-screen__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  white-space: nowrap;
}

.kodza-hero-screen__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.kodza-hero-screen__lead {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(16px, 1.3cqi, 18px);
  line-height: 1.55;
  color: var(--kz-hero-screen-dim);
  text-wrap: balance;
}

.kodza-hero-screen__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.kodza-hero-screen__button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.kodza-hero-screen__button:focus-visible {
  outline: 2px solid var(--kz-hero-screen-ink);
  outline-offset: 3px;
}

/* Solid: the arrow steps forward on hover */
.kodza-hero-screen__button--ink {
  background: var(--kz-hero-screen-ink);
  color: var(--kz-hero-screen-paper);
}

.kodza-hero-screen__arrow {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--kz-hero-screen-ease);
}

/* Soft: ink rises from the bottom edge on hover */
.kodza-hero-screen__button--soft {
  background: var(--kz-hero-screen-soft);
  color: var(--kz-hero-screen-ink);
  transition: color 0.4s var(--kz-hero-screen-ease);
}

.kodza-hero-screen__button--soft::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--kz-hero-screen-ink);
  transform: translateY(101%);
  transition: transform 0.4s var(--kz-hero-screen-ease);
}

@media (hover: hover) {
  .kodza-hero-screen__button--ink:hover .kodza-hero-screen__arrow {
    transform: translateX(4px);
  }

  .kodza-hero-screen__button--soft:hover {
    color: var(--kz-hero-screen-paper);
  }

  .kodza-hero-screen__button--soft:hover::before {
    transform: none;
  }
}

/* The screen, without the script: upright under the words */
.kodza-hero-screen__stage {
  box-sizing: border-box;
  padding: 0 max(var(--kz-hero-screen-gutter), env(safe-area-inset-right, 0px)) clamp(56px, 7vw, 104px) max(var(--kz-hero-screen-gutter), env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.kodza-hero-screen__device {
  width: min(100%, var(--kz-hero-screen-width));
  margin: 0 auto;
  transform-origin: 50% 0;
}

/* The script leans it back from its top edge, in its own perspective */
.kodza-hero-screen__tilt {
  position: relative;
  transform-origin: 50% 0;
}

.kodza-hero-screen__shadow {
  position: absolute;
  inset: 0;
  border-radius: var(--kz-hero-screen-radius);
}

.kodza-hero-screen__shadow--far {
  box-shadow: var(--kz-hero-screen-shadow-far);
  opacity: 0;
}

.kodza-hero-screen__shadow--near {
  box-shadow: var(--kz-hero-screen-shadow-near);
}

/* On arrival the frame opens from its top edge down: the curtain slides down while its content
   slides up by as much, so the screen itself stays put */
.kodza-hero-screen__curtain {
  position: relative;
  overflow: hidden;
  border-radius: var(--kz-hero-screen-radius);
}

.kodza-hero-screen__frame {
  position: relative;
  box-sizing: border-box;
  padding: clamp(4px, 0.5cqi, 7px);
  border: 1px solid var(--kz-hero-screen-edge);
  border-radius: var(--kz-hero-screen-radius);
  background: var(--kz-hero-screen-bezel);
}

.kodza-hero-screen__glass {
  overflow: hidden;
  border-radius: calc(var(--kz-hero-screen-radius) - clamp(4px, 0.5cqi, 7px) - 1px);
}

.kodza-hero-screen__glass img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.kodza-hero-screen__veil {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--kz-hero-screen-veil);
  opacity: 0;
}

/* With the script and motion: a tall section, the scene pinned inside it, the copy at the top and
   the screen in its place at the centre (the script leans it back from there) */
@media (prefers-reduced-motion: no-preference) {
  .kodza-hero-screen.is-ready {
    height: calc(100svh - var(--kz-hero-screen-top) + var(--kz-hero-screen-distance));
  }

  .kodza-hero-screen.is-ready .kodza-hero-screen__scene {
    position: sticky;
    top: var(--kz-hero-screen-top);
    overflow: hidden;
    overflow: clip;
    height: calc(100svh - var(--kz-hero-screen-top));
  }

  .kodza-hero-screen.is-ready .kodza-hero-screen__copy {
    padding-top: clamp(28px, 11svh, 120px);
    padding-bottom: clamp(24px, 5.5svh, 56px);
  }

  .kodza-hero-screen.is-ready .kodza-hero-screen__stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    padding-top: var(--kz-hero-screen-pad-y);
    padding-bottom: var(--kz-hero-screen-pad-y);
  }

  .kodza-hero-screen.is-ready .kodza-hero-screen__device {
    width: min(100%, var(--kz-hero-screen-width), (100svh - var(--kz-hero-screen-top) - 2 * var(--kz-hero-screen-pad-y)) * var(--kz-hero-screen-ratio));
  }

  .kodza-hero-screen.is-ready .kodza-hero-screen__shadow--far,
  .kodza-hero-screen.is-ready .kodza-hero-screen__veil {
    opacity: 1;
  }

  .kodza-hero-screen.is-ready .kodza-hero-screen__shadow--near {
    opacity: 0;
  }

  /* Waiting for its entrance: the script sets is-shown and plays the motion in the same frame */
  .kodza-hero-screen.is-ready:not(.is-shown) .kodza-hero-screen__rise {
    transform: translateY(105%);
  }

  .kodza-hero-screen.is-ready:not(.is-shown) .kodza-hero-screen__curtain {
    transform: translateY(-100%);
  }

  .kodza-hero-screen.is-ready:not(.is-shown) .kodza-hero-screen__hold {
    transform: translateY(100%);
  }

  .kodza-hero-screen.is-ready:not(.is-shown) .kodza-hero-screen__lead,
  .kodza-hero-screen.is-ready:not(.is-shown) .kodza-hero-screen__actions,
  .kodza-hero-screen.is-ready:not(.is-shown) .kodza-hero-screen__shadows {
    opacity: 0;
  }

  /* A phone: a whole desktop screen would be too small to read, so it lands bigger, from the left
     gutter, and runs off the right edge (the scene cuts it) */
  @container kodza-hero-screen (max-width: 640px) {
    .kodza-hero-screen.is-ready .kodza-hero-screen__device {
      justify-self: start;
      width: 170%;
    }
  }
}

/* A phone: the buttons share the row */
@container kodza-hero-screen (max-width: 520px) {
  .kodza-hero-screen__foot {
    align-self: stretch;
  }

  .kodza-hero-screen__button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kodza-hero-screen *,
  .kodza-hero-screen *::before,
  .kodza-hero-screen *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* kodza-guard e146b4536f11 — 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-hero-screen__eyebrow):not(#_),
:where(.kodza-hero-screen__title):not(#_),
:where(.kodza-hero-screen__lead):not(#_),
:where(.kodza-hero-screen__glass img:where(:not([class*="kodza-"]))):not(#_) {
  transition-duration: revert;
}

:where(.kodza-hero-screen__button):not(#_) {
  outline: revert;
  transition: revert;
  outline-offset: revert;
}

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

.kodza-hero-screen__scene:not(#_),
.kodza-hero-screen__rise:not(#_),
.kodza-hero-screen__line:not(#_),
.kodza-hero-screen__foot:not(#_),
.kodza-hero-screen__actions:not(#_),
.kodza-hero-screen__device:not(#_),
.kodza-hero-screen__tilt:not(#_),
.kodza-hero-screen__shadows:not(#_),
.kodza-hero-screen__shadow:not(#_),
.kodza-hero-screen__curtain:not(#_),
.kodza-hero-screen__hold:not(#_),
.kodza-hero-screen__glass:not(#_),
.kodza-hero-screen__veil:not(#_) {
  box-sizing: revert;
}

.kodza-hero-screen__eyebrow:not(#_) {
  border: 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-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;
  transition-property: revert;
  transition-timing-function: revert;
  transition-delay: revert;
}

.kodza-hero-screen__title:not(#_) {
  border: 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-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-style: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
  transition-property: revert;
  transition-timing-function: revert;
  transition-delay: revert;
}

.kodza-hero-screen__lead:not(#_) {
  border: 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;
  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;
  transition-property: revert;
  transition-timing-function: revert;
  transition-delay: revert;
}

.kodza-hero-screen__button:not(#_) {
  margin: revert;
  list-style: revert;
  float: revert;
  box-shadow: revert;
  appearance: revert;
  max-width: revert;
  max-height: 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-hero-screen__arrow: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-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-hero-screen__glass img:where(:not([class*="kodza-"])):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;
  transition-property: revert;
  transition-timing-function: revert;
  transition-delay: revert;
}

.kodza-hero-screen__eyebrow:not(#_):where(:not([hidden])),
.kodza-hero-screen__title:not(#_):where(:not([hidden])),
.kodza-hero-screen__lead:not(#_):where(:not([hidden])),
.kodza-hero-screen__arrow:not(#_):where(:not([hidden])) {
  display: revert;
}

.kodza-hero-screen__eyebrow:not(#_):where([hidden]),
.kodza-hero-screen__title:not(#_):where([hidden]),
.kodza-hero-screen__lead:not(#_):where([hidden]),
.kodza-hero-screen__arrow:not(#_):where([hidden]) {
  display: none;
}

/* 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-hero-screen__eyebrow:not(#_) {
  margin: 0 0 clamp(16px, 2cqi, 26px);
  font-family: var(--kz-hero-screen-mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--kz-hero-screen-faint);
}

.kodza-hero-screen__title:not(#_) {
  margin: 0 0 clamp(20px, 2.4cqi, 30px);
  font-size: var(--kz-hero-screen-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}

.kodza-hero-screen__lead:not(#_) {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(16px, 1.3cqi, 18px);
  line-height: 1.55;
  color: var(--kz-hero-screen-dim);
}

.kodza-hero-screen__button:not(#_) {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.kodza-hero-screen__button:focus-visible:not(#_) {
  outline: 2px solid var(--kz-hero-screen-ink);
  outline-offset: 3px;
}

.kodza-hero-screen__button--ink:not(#_) {
  background: var(--kz-hero-screen-ink);
  color: var(--kz-hero-screen-paper);
}

.kodza-hero-screen__arrow:not(#_) {
  transition: transform 0.3s var(--kz-hero-screen-ease);
}

.kodza-hero-screen__button--soft:not(#_) {
  background: var(--kz-hero-screen-soft);
  color: var(--kz-hero-screen-ink);
  transition: color 0.4s var(--kz-hero-screen-ease);
}

@media (hover: hover) {
  .kodza-hero-screen__button--soft:hover:not(#_) {
    color: var(--kz-hero-screen-paper);
  }
}

.kodza-hero-screen__glass img:not(#_) {
  display: block;
  max-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .kodza-hero-screen *:where(p, h1, a, svg, img):not(#_) {
    transition-duration: 0.01ms !important;
  }
}
```

```js
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Kodza — Hero Screen
// Plays the entrance of Hero Split once the section is in view (the label and title lines rise
// out of their masks, the screen opens from its top edge down, the rest follows), then hands over
// to the scroll: the scene pins while the screen, leaning back under the title, stands up to face
// you and grows to its real size, passing over the title as it steps back. Leaning, the screen
// sits in shade under a long soft shadow; upright, it lights up and the shadow tucks in. Every move
// is a paused animation set from the scroll: scrolling back up plays it in reverse.
// "kodza:replay" plays the entrance again.
(() => {
  const SELECTOR = '.kodza-hero-screen';
  const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
  const GLIDE = 'cubic-bezier(0.6, 0, 0.1, 1)'; // slow start, long settle
  const SOFT = 'cubic-bezier(0.25, 1, 0.5, 1)';
  const TRAVEL = 'cubic-bezier(0.45, 0, 0.55, 1)'; // the moves on the scroll: gentle, a mouse wheel goes by notches

  const decoded = (root) => Promise.all([...root.querySelectorAll('img')].map((img) => img.decode().catch(() => {})));

  // ---------- Scroll engine (begin) ----------
  // The same block in every hero that plays on scroll: copy it as is, write only the timeline.
  // `root` is a tall track and `scene` sticks inside it (position: sticky, in the CSS); the
  // progress runs from 0, the scene just pinned, to 1, about to unpin. `timeline()` returns
  // tracks, [element, keyframes, from, to] with from and to in progress; each becomes a paused
  // Web Animation whose time follows the scroll, smoothed by a requestAnimationFrame loop that
  // sleeps once it has caught up. The tracks are built again when `scene` or an element of
  // `watch` changes size, so `timeline()` measures there.
  function scrub(root, scene, signal, timeline, watch = []) {
    const SPAN = 1000;
    let tracks = [];
    let live = false;
    let now = 0;
    let target = 0;
    let frame = 0;
    let last = 0;
    const geometry = () => {
      const box = root.getBoundingClientRect();
      return {
        top: box.top,
        scale: box.height / root.offsetHeight || 1, // a parent scaled by transform
        run: root.offsetHeight - scene.offsetHeight,
        stick: parseFloat(getComputedStyle(scene).top) || 0,
      };
    };
    const progress = () => {
      const { top, scale, run, stick } = geometry();
      return run > 0 ? Math.min(1, Math.max(0, (stick - top / scale) / run)) : 0;
    };
    const seek = () => tracks.forEach((a) => { a.currentTime = now * SPAN; });
    const tick = (time) => {
      const dt = last ? Math.min(time - last, 64) : 16;
      last = time;
      now += (target - now) * (1 - Math.exp(-dt / 70));
      if (Math.abs(target - now) < 0.0004) now = target;
      seek();
      frame = now === target ? 0 : requestAnimationFrame(tick);
      if (!frame) last = 0;
    };
    const update = () => {
      if (!live) return;
      target = progress();
      if (!frame) frame = requestAnimationFrame(tick);
    };
    const clear = () => {
      tracks.forEach((a) => a.cancel());
      tracks = [];
    };
    const build = () => {
      clear();
      if (!live) return;
      tracks = timeline().filter(([el]) => el).map(([el, keyframes, from, to]) => {
        const a = el.animate(keyframes, { duration: (to - from) * SPAN, delay: from * SPAN, endDelay: (1 - to) * SPAN, fill: 'both' });
        a.pause();
        return a;
      });
      seek();
      update();
    };
    const stop = () => {
      live = false;
      cancelAnimationFrame(frame);
      frame = last = now = 0;
      clear();
    };
    // Scrolls the page so the progress is at least `p` (a focused control must show)
    const reveal = (p) => {
      const { top, scale, run, stick } = geometry();
      if (run > 0 && progress() < p) window.scrollBy(0, top - (stick - p * run) * scale);
    };

    document.addEventListener('scroll', update, { passive: true, capture: true, signal });
    window.addEventListener('resize', update, { passive: true, signal });
    let resized = 0;
    const ro = new ResizeObserver(() => {
      cancelAnimationFrame(resized);
      resized = requestAnimationFrame(build);
    });
    [scene, ...watch].forEach((el) => el && ro.observe(el));
    signal.addEventListener('abort', () => {
      ro.disconnect();
      cancelAnimationFrame(resized);
      stop();
    });
    return {
      start() {
        live = true;
        build();
      },
      stop,
      progress,
      reveal,
    };
  }
  // ---------- Scroll engine (end) ----------

  // 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) {
    if (reduceMotion) return root.classList.add('is-shown');
    const q = (s) => root.querySelector(s);
    const scene = q('.kodza-hero-screen__scene');
    const copy = q('.kodza-hero-screen__copy');
    const device = q('.kodza-hero-screen__device');
    const tilt = q('.kodza-hero-screen__tilt');
    const lines = [...root.querySelectorAll('.kodza-hero-screen__line')];
    const setting = (name, fallback) => {
      const value = parseFloat(getComputedStyle(root).getPropertyValue(`--kz-hero-screen-${name}`));
      return Number.isFinite(value) ? value : fallback;
    };

    // The screen sits in its place at the centre of the scene (the CSS puts it there). At rest it
    // leans back from its top edge, smaller, that edge just under the copy: these are the
    // transforms that take it there, set inline so the entrance plays on the leaning screen.
    // Layout boxes only (offsetTop…): they ignore transforms, so a scaled page changes nothing.
    const measure = () => {
      const rest = {
        device: `translateY(${copy.offsetTop + copy.offsetHeight - device.offsetTop}px) scale(${setting('shrink', 0.86)})`,
        tilt: `perspective(${setting('depth', 1600)}px) rotateX(${setting('tilt', 24)}deg)`,
      };
      device.style.transform = rest.device;
      tilt.style.transform = rest.tilt;
      return rest;
    };

    // The scroll part, in progress: the screen stands up first, then grows into its place, and
    // holds there for the last stretch before the page goes on
    const timeline = () => {
      const rest = measure();
      const fade = (el, from, to, start, end) => [el, [{ opacity: from, easing: TRAVEL }, { opacity: to }], start, end];
      // The copy steps back as the screen comes up over it, its lowest lines first
      const words = [q('.kodza-hero-screen__actions'), q('.kodza-hero-screen__lead'), ...[...lines].reverse(), q('.kodza-hero-screen__eyebrow')];
      return [
        [tilt, [{ transform: rest.tilt, easing: TRAVEL }, { transform: rest.tilt.replace(/rotateX\([^)]*\)/, 'rotateX(0deg)') }], 0, 0.62],
        [device, [{ transform: rest.device, easing: TRAVEL }, { transform: 'translateY(0px) scale(1)' }], 0, 0.74],
        // Leaning, it sits in shade under a long soft shadow; facing you, it lights up and the
        // shadow tucks in under it
        fade(q('.kodza-hero-screen__veil'), 1, 0, 0, 0.62),
        fade(q('.kodza-hero-screen__shadow--far'), 1, 0, 0.05, 0.6),
        fade(q('.kodza-hero-screen__shadow--near'), 0, 1, 0.25, 0.72),
        [copy, [
          { transform: 'translateY(0px) scale(1)', easing: TRAVEL },
          { transform: `translateY(${-0.06 * scene.clientHeight}px) scale(0.9)` },
        ], 0, 0.6],
        ...words.map((el, i) => fade(el, 1, 0, i * 0.035, 0.3 + i * 0.045)),
      ];
    };
    const pin = scrub(root, scene, signal, timeline, [copy]);

    let running = [];
    const stop = () => {
      running.forEach((a) => a.cancel());
      running = [];
    };
    const animate = (el, keyframes, options) => {
      if (el) running.push(el.animate(keyframes, { easing: GLIDE, fill: 'backwards', ...options }));
    };
    const rise = (el, delay, duration) => animate(el, [{ transform: 'translateY(105%)' }, { transform: 'none' }], { duration, delay });
    // Scrolling during the entrance hurries it, so the scroll takes over without a wait
    const hurry = () => {
      if (running.length && !root.classList.contains('is-live') && pin.progress() > 0) running.forEach((a) => a.updatePlaybackRate(4));
    };

    const play = async () => {
      await decoded(root);
      if (signal.aborted) return;
      stop();
      pin.stop();
      root.classList.remove('is-live');
      root.classList.add('is-shown');
      measure();
      rise(q('.kodza-hero-screen__eyebrow .kodza-hero-screen__rise'), 0, 1000);
      lines.forEach((l, i) => rise(l.querySelector(':scope > .kodza-hero-screen__rise'), 110 + i * 125, 1170));
      // The screen opens from its top edge down, settling from a slight zoom
      animate(q('.kodza-hero-screen__curtain'), [{ transform: 'translateY(-100%)' }, { transform: 'none' }], { duration: 1350, delay: 200 });
      animate(q('.kodza-hero-screen__hold'), [{ transform: 'translateY(100%)' }, { transform: 'none' }], { duration: 1350, delay: 200 });
      animate(q('.kodza-hero-screen__glass img'), [{ transform: 'scale(1.2)' }, { transform: 'none' }], { duration: 2000, delay: 200, easing: SOFT });
      // Its shadow comes once it is mostly open, never around an empty frame
      animate(q('.kodza-hero-screen__shadows'), [{ opacity: 0 }, { opacity: 1 }], { duration: 1000, delay: 1000, easing: SOFT });
      [q('.kodza-hero-screen__lead'), q('.kodza-hero-screen__actions')].forEach((el, i) => {
        animate(el, [{ opacity: 0, transform: 'translateY(20px)' }, { opacity: 1, transform: 'none' }], { duration: 900, delay: 700 + i * 110, easing: SOFT });
      });
      hurry();
      const entrance = running;
      Promise.all(entrance.map((a) => a.finished)).then(() => {
        if (entrance !== running || signal.aborted) return;
        root.classList.add('is-live');
        pin.start();
      }, () => {});
    };

    root.addEventListener('kodza:replay', play, { signal });
    document.addEventListener('scroll', hurry, { passive: true, capture: true, signal });
    // Tabbing back to a button scrolls back to where it shows: the hero, whole
    q('.kodza-hero-screen__foot').addEventListener('focusin', () => {
      if (pin.progress() <= 0) return;
      const box = root.getBoundingClientRect();
      const k = box.height / root.offsetHeight || 1;
      window.scrollBy(0, box.top - (parseFloat(getComputedStyle(scene).top) || 0) * k);
    }, { signal });
    signal.addEventListener('abort', stop);
    const io = new IntersectionObserver((entries) => {
      if (!entries.some((entry) => entry.isIntersecting)) return;
      io.disconnect();
      play();
    }, { rootMargin: '0px 0px -15% 0px' });
    signal.addEventListener('abort', () => io.disconnect());
    Promise.all([document.fonts?.ready, decoded(root)]).then(() => {
      if (!signal.aborted) io.observe(root);
    });
  }

  // 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.
  const instances = new WeakMap();
  const find = (scope = document) => [scope, ...scope.querySelectorAll(SELECTOR)].filter((el) => el.matches?.(SELECTOR));
  const init = (scope) => find(scope).forEach((root) => {
    if (root.classList.contains('is-ready')) return; // already running, maybe from another copy of this script
    const controller = new AbortController();
    instances.set(root, { controller, html: root.innerHTML, attrs: [...root.attributes].map((a) => [a.name, a.value]) });
    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.controller.abort();
    [...root.attributes].forEach((a) => root.removeAttribute(a.name));
    instance.attrs.forEach(([name, value]) => root.setAttribute(name, value));
    root.innerHTML = instance.html;
  });
  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).
