      /* the artwork fills the whole screen, edge to edge, with the menu floating over it.
         Drag to look around; tap (or click) to dive in closer, tap again to come back out. */
      html,
      body,
      main.art-page {
        /* the same crayon earth as the first page */
        background: #34150e url('/img/ground.jpg') repeat center / 402px 215px;
        overflow: hidden;
        overscroll-behavior: none;
      }
      .art-page {
        position: fixed;
        inset: 0;
        padding: 0;
      }
      .frame {
        position: absolute;
        inset: 0;
        overflow: hidden;
        cursor: grab;
        touch-action: none;
      }
      /* fiery roots creeping out from behind the painting into the dirt */
      .fire {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
      }
      .fire.paper-layer {
        overflow: visible;
        width: 100%;
        height: 100%;
      }
      .fire .carry {
        transform-box: view-box;
        transform-origin: 0 0;
        transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
      }
      .frame.dragging .fire .carry {
        transition: none;
      }
      /* the paper and its roots come in together, as one piece */
      .sheet,
      .fire.paper-layer {
        transition-property: transform, opacity, translate;
        transition-duration: 0.45s, 0.8s, 1s;
        transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
      }
      .frame.arriving .sheet,
      .frame.arriving .fire.paper-layer {
        opacity: 0;
        translate: 0 26px;
      }
      @media (prefers-reduced-motion: reduce) {
        .frame.arriving .sheet,
        .frame.arriving .fire.paper-layer {
          translate: none;
        }
      }
      .fire g.cl {
        transform-box: fill-box;
        transition: transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s;
      }
      /* blinking eyes in the dirt, like the home page */
      .fire image.eye {
        transform-box: fill-box;
        transform-origin: center;
        animation: blink 7s infinite;
      }
      @keyframes blink {
        0%, 95%, 100% { transform: scaleY(1); }
        97.5% { transform: scaleY(0.08); }
      }
      @media (prefers-reduced-motion: reduce) {
        .fire image.eye { animation: none; }
      }
      .fire g.cl.wait {
        transform: scale(0.05);
        opacity: 0;
      }
      .frame.dragging {
        cursor: grabbing;
      }
      .sheet {
        position: absolute;
        inset: 0;
        z-index: 1;
        filter: drop-shadow(0 10px 28px rgba(10, 4, 2, 0.7));
        pointer-events: none;
      }
      .sheet .stage {
        pointer-events: auto;
      }
      .sheet.torn-r {
        display: none;
      }
      /* phones held upright: the painting is torn in two along a ragged line between the creatures,
         and the right half is laid underneath, so the whole thing fits the screen at a readable size */
      body.torn .sheet.torn-r {
        display: block;
      }
      body.torn .sheet {
        filter: drop-shadow(0 6px 10px rgba(10, 4, 2, 0.8)) drop-shadow(0 0 1.5px #f3dcc0);
      }
      .art-page .stage {
        /* not the home page's first screen, which shares this class name */
        background: none;
        height: auto;
        display: block;
        overflow: visible;
      }
      .stage {
        position: absolute;
        z-index: 1;
        top: 0;
        left: 0;
        width: var(--iw);
        height: var(--ih);
        transform-origin: 0 0;
        transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
        user-select: none;
        -webkit-user-select: none;
      }
      .stage > img {
        display: block;
        width: var(--iw);
        height: var(--ih);
        max-width: none;
        -webkit-user-drag: none;
      }
      .frame.dragging .stage {
        transition: none;
      }

      /* ---------- the living bits: pieces of the painting you can poke, drag and wake up ---------- */
      .hole,
      .piece {
        position: absolute;
        background-image: var(--art);
        background-size: var(--iw) var(--ih);
        background-repeat: no-repeat;
      }
      /* what shows underneath when a piece moves: the painting's own colours, smeared, so there's never a hard hole.
         Eyelids get the creature's skin colour instead. */
      .hole {
        filter: blur(14px) saturate(1.15) brightness(0.92);
      }
      .hole.lid {
        background-image: none;
        background-color: var(--lid);
        filter: none;
      }
      .piece {
        cursor: pointer;
        transform-origin: var(--ox, 50%) var(--oy, 50%);
        transition: transform 0.6s cubic-bezier(0.3, 1.6, 0.5, 1), filter 0.3s;
        will-change: transform;
      }
      .piece.held {
        cursor: grabbing;
        transition: filter 0.3s;
        filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.55)) brightness(1.08);
      }
      .piece.lifted {
        filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.55));
      }
      .piece[data-kind='drag'] {
        cursor: grab;
      }
      .piece.shut {
        transition: transform 0.09s ease-in;
        transform: scaleY(0.06) !important;
      }
      .piece.spinning {
        animation: spin 2.4s linear infinite;
      }
      .piece.whirl {
        animation: whirl 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
      }
      @keyframes spin {
        to { rotate: 360deg; }
      }
      @keyframes whirl {
        to { rotate: 1080deg; }
      }
      .piece.jelly {
        animation: jelly 0.9s;
      }
      @keyframes jelly {
        0%, 100% { scale: 1 1; }
        25% { scale: 1.16 0.86; }
        45% { scale: 0.88 1.14; }
        65% { scale: 1.07 0.94; }
        82% { scale: 0.97 1.03; }
      }
      .piece.beat {
        animation: beat 0.8s 2;
      }
      @keyframes beat {
        0%, 40%, 100% { scale: 1; }
        15% { scale: 1.22; }
        28% { scale: 1.06; }
      }
      .piece.growl {
        animation: growl 0.5s;
      }
      @keyframes growl {
        0%, 100% { translate: 0 0; }
        20% { translate: -5px 2px; rotate: -2deg; }
        40% { translate: 5px -2px; rotate: 2deg; }
        60% { translate: -4px 1px; rotate: -1deg; }
        80% { translate: 3px 0; }
      }
      .piece.duck {
        animation: duck 1.3s cubic-bezier(0.3, 1.2, 0.5, 1);
      }
      @keyframes duck {
        0%, 100% { translate: 0 0; rotate: 0deg; }
        25%, 70% { translate: -34px 40px; rotate: -16deg; }
      }
      .rain {
        position: absolute;
        width: 7px;
        height: 14px;
        border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
        background: #2c5fd6;
        border: 1.5px solid #10204a;
        pointer-events: none;
        opacity: 0;
        animation: rain 1s cubic-bezier(0.5, 0, 1, 0.5) forwards;
      }
      @keyframes rain {
        0% { opacity: 1; transform: translateY(0); }
        85% { opacity: 1; }
        100% { opacity: 0; transform: translateY(170px); }
      }
      .ripple {
        position: absolute;
        border: 3px solid rgba(190, 225, 255, 0.85);
        border-radius: 50%;
        pointer-events: none;
        animation: ripple 1s ease-out forwards;
      }
      @keyframes ripple {
        from { transform: scale(0.2); opacity: 1; }
        to { transform: scale(2.6); opacity: 0; }
      }
      @media (prefers-reduced-motion: reduce) {
        .piece { transition: none; }
        .piece.spinning, .piece.whirl, .piece.jelly, .piece.beat, .piece.growl { animation: none; }
      }
      .top.dark {
        background: rgba(20, 8, 24, 0.55);
        transition: translate 0.35s ease, opacity 0.35s ease;
      }
      /* the menu tucks away so the art has the whole screen; it slides back when the cursor goes to the top */
      .top.dark.tucked {
        translate: 0 -100%;
        opacity: 0;
      }
      /* the little map at the bottom, phones only */
      .mini {
        display: none;
        position: fixed;
        z-index: 5;
        left: 50%;
        bottom: max(54px, calc(env(safe-area-inset-bottom) + 46px));
        translate: -50% 0;
        width: min(62vw, 260px);
        aspect-ratio: 3 / 2;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(244, 236, 214, 0.5);
        opacity: 0.88;
      }
      .mini img {
        display: block;
        width: 100%;
        height: 100%;
        filter: brightness(0.7);
      }
      .mini i {
        position: absolute;
        top: 0;
        bottom: 0;
        border: 2px solid #f4ecd6;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.12);
        box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25);
      }
      .hint {
        z-index: 6;
        position: fixed;
        left: 50%;
        bottom: max(16px, env(safe-area-inset-bottom));
        translate: -50% 0;
        margin: 0;
        padding: 7px 14px;
        border-radius: 999px;
        background: rgba(20, 8, 24, 0.82);
        color: var(--bone);
        font-size: 14px;
        white-space: nowrap;
        pointer-events: none;
        transition: opacity 0.4s;
      }
      .hint.gone {
        opacity: 0;
      }
      @media (prefers-reduced-motion: reduce) {
        .stage {
          transition: none;
        }
      }
    
      /* more ways to wake things up */
      .piece.shut.x {
        transform: scaleX(0.06) !important;
      }
      .piece.sway {
        animation: sway 1.6s ease-out;
      }
      @keyframes sway {
        0%, 100% { rotate: 0deg; }
        15% { rotate: 14deg; }
        38% { rotate: -10deg; }
        60% { rotate: 6deg; }
        80% { rotate: -3deg; }
      }
      .piece.chomp {
        animation: chomp 0.9s;
      }
      @keyframes chomp {
        0%, 100% { scale: 1 1; }
        18% { scale: 1.03 0.84; }
        36% { scale: 1 1.02; }
        56% { scale: 1.03 0.86; }
        76% { scale: 1 1.01; }
      }
      .piece.hop {
        animation: hop 1.1s cubic-bezier(0.3, 0.9, 0.4, 1);
      }
      @keyframes hop {
        0%, 100% { translate: 0 0; rotate: 0deg; }
        15% { translate: 0 14px; rotate: 0deg; }
        45% { translate: 0 -150px; rotate: 200deg; }
        70% { translate: 0 0; rotate: 360deg; }
        82% { translate: 0 8px; rotate: 360deg; }
      }
      @media (prefers-reduced-motion: reduce) {
        .piece.sway, .piece.chomp, .piece.hop { animation: none; }
      }

      /* ---------- hand-drawn arrows to the next / previous painting ---------- */
      .scene-arrow {
        position: fixed;
        z-index: 4;
        width: 108px;
        height: 72px;
        translate: -50% -50%;
        filter: drop-shadow(0 5px 6px rgba(10, 4, 2, 0.7));
        transition: opacity 0.4s, scale 0.2s;
        -webkit-tap-highlight-color: transparent;
      }
      .scene-arrow svg {
        display: block;
        width: 100%;
        height: 100%;
        overflow: visible;
      }
      .scene-arrow.prev svg {
        scale: -1 1;
      }
      .scene-arrow:hover,
      .scene-arrow:focus-visible {
        scale: 1.08;
      }
      .scene-arrow:hover .tip,
      .scene-arrow:focus-visible .tip {
        animation: nudge 0.7s ease-in-out infinite;
      }
      @keyframes nudge {
        50% { translate: 6px 0; }
      }
      .scene-arrow .lid {
        transform-box: fill-box;
        transform-origin: center;
        animation: arrow-blink 6s infinite;
      }
      @keyframes arrow-blink {
        0%, 94%, 100% { scale: 1 0; }
        97% { scale: 1 1; }
      }
      .frame.arriving ~ .scene-arrow,
      body.leaving .scene-arrow {
        opacity: 0;
        pointer-events: none;
      }
      @media (max-width: 760px) {
        .scene-arrow {
          width: 72px;
          height: 48px;
        }
      }

      /* phones: the rope the stage hangs from */
      .fire .rope {
        fill: none;
        stroke-linecap: round;
      }

      /* ---------- turning the page between paintings ----------
         The browser hands the old page straight to the new one: the backgrounds blend into each other
         (never through dark), the old painting folds gently back on its edge while the new one settles in.
         scene.js varies the angles and timing a little every time. */
      @view-transition {
        navigation: auto;
      }
      .sheet .stage {
        view-transition-name: paper;
      }
      .sheet.torn-r .stage {
        view-transition-name: paper-r;
      }
      ::view-transition-group(root) {
        animation-duration: var(--in-ms, 1.4s);
        animation-timing-function: ease-in-out;
      }
      ::view-transition-old(root),
      ::view-transition-new(root) {
        animation-duration: var(--in-ms, 1.4s);
        animation-timing-function: ease-in-out;
      }
      ::view-transition-group(paper),
      ::view-transition-group(paper-r) {
        animation: none; /* no morphing between the two paintings' sizes: each turns on its own */
      }
      ::view-transition-image-pair(paper),
      ::view-transition-image-pair(paper-r) {
        isolation: auto;
      }
      ::view-transition-old(paper),
      ::view-transition-old(paper-r) {
        transform-origin: left center;
        animation: page-away var(--out-ms, 1s) cubic-bezier(0.4, 0, 0.6, 1) both;
      }
      ::view-transition-new(paper),
      ::view-transition-new(paper-r) {
        transform-origin: left center;
        animation: page-land var(--in-ms, 1.4s) cubic-bezier(0.3, 0.6, 0.35, 1) both;
      }
      ::view-transition-new(paper-r),
      ::view-transition-old(paper-r) {
        animation-delay: var(--lag, 120ms);
      }
      html.turn-back::view-transition-old(paper),
      html.turn-back::view-transition-old(paper-r),
      html.turn-back::view-transition-new(paper),
      html.turn-back::view-transition-new(paper-r) {
        transform-origin: right center;
        --dir: -1;
      }
      @keyframes page-away {
        from {
          transform: perspective(2600px) rotateY(0deg);
          opacity: 1;
        }
        to {
          transform: perspective(2600px) rotateY(calc(var(--away, 55deg) * var(--dir, 1))) rotateZ(var(--tilt, 0deg)) skewY(var(--curl, 0deg));
          opacity: 0;
        }
      }
      @keyframes page-land {
        0% {
          transform: perspective(2600px) rotateY(calc(var(--land, 34deg) * var(--dir, 1))) rotateZ(calc(var(--tilt, 0deg) * -1));
          opacity: 0;
        }
        45% {
          opacity: 1;
        }
        70% {
          transform: perspective(2600px) rotateY(calc(var(--over, 2.5deg) * var(--dir, 1) * -1)) skewY(calc(var(--curl, 0deg) * -0.4));
        }
        100% {
          transform: perspective(2600px) rotateY(0deg);
          opacity: 1;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        ::view-transition-group(*),
        ::view-transition-old(*),
        ::view-transition-new(*) {
          animation: none !important;
        }
      }

      /* ---------- phones held upright: the painting on its side, or torn in two ---------- */
      .tear-btn {
        position: fixed;
        z-index: 5;
        left: 50%;
        translate: -50% -50%;
        padding: 7px 14px;
        border: 0;
        border-radius: 999px;
        background: rgba(20, 8, 6, 0.62);
        font: 700 15px/1.2 Outfit, system-ui, sans-serif;
        color: var(--acid, #d3e840);
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 5px;
        white-space: nowrap;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.4s, opacity 0.4s;
      }
      .tear-btn[hidden] {
        display: none;
      }
      .tear-btn:active {
        color: var(--cream, #ffefd9);
      }
      .frame.arriving ~ .tear-btn {
        opacity: 0;
      }
      /* while the paper tears or comes back together, the roots and eyes step aside */
      .fire {
        transition: opacity 0.5s;
      }
      .frame.tearing .fire {
        opacity: 0;
        transition-duration: 0.25s;
      }

      /* phones: the page turn carries each piece of paper as a screen-sized picture (with its shadow),
         not the full-size painting, which is much lighter for a phone to animate */
      body.torn .sheet .stage,
      body.sideways .sheet .stage {
        view-transition-name: none;
      }
      body.torn .sheet:not(.torn-r),
      body.sideways .sheet:not(.torn-r) {
        view-transition-name: paper;
      }
      body.torn .sheet.torn-r {
        view-transition-name: paper-r;
      }
