/* Clip-path image reveal — CSS scroll-driven animations.
   The frame (.reveal) is clipped open; the picture inside (.reveal__media)
   counter-zooms from 1.25 to 1 on the same timeline. */

.cr-figure { margin: 0; }

.reveal {
  overflow: hidden;
  border-radius: 20px;
}

.reveal__media {
  aspect-ratio: 16 / 10;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 45%; /* starts as it enters, done before the middle */
    }
    .reveal__media {
      animation: reveal-zoom linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 60%;
    }
    .reveal--side { animation-name: reveal-side; }
    .reveal--iris { animation-name: reveal-iris; }

    /* scroll-linked progress is linear; give it the token curve per keyframe */
    .reveal,
    .reveal__media { animation-timing-function: var(--ease-move); }
  }
}

@keyframes reveal-up {
  from { clip-path: inset(100% 0 0 0 round 20px); }
  to   { clip-path: inset(0 0 0 0 round 20px); }
}
@keyframes reveal-side {
  from { clip-path: inset(0 100% 0 0 round 20px); }
  to   { clip-path: inset(0 0 0 0 round 20px); }
}
@keyframes reveal-iris {
  from { clip-path: circle(0% at 50% 50%); }
  to   { clip-path: circle(75% at 50% 50%); }
}
@keyframes reveal-zoom {
  from { transform: scale(1.25); }
  to   { transform: scale(1); }
}

/* Reduced motion and older browsers: the images are simply there. */

/* generative artwork (CSS only, no image files) */
.art--sun {
  background:
    radial-gradient(circle at 50% 46%, #ffb38a 0 16%, #ff6a3d 16.5% 22%, transparent 22.5%),
    repeating-linear-gradient(180deg, #2a1610 0 18px, #3b1d13 18px 36px);
}
.art--grid {
  background:
    conic-gradient(from 90deg at 2px 2px, transparent 25%, #0f0e0c 0) 0 0 / 12.5% 20%,
    linear-gradient(135deg, #ff6a3d, #e9dcc6 55%, #3a332b);
}
.art--rings {
  background: repeating-radial-gradient(circle at 50% 50%, #ff6a3d 0 10px, #1f1c18 10px 30px, #e9dcc6 30px 34px, #1f1c18 34px 54px);
}

/* demo layout */
.cr-stage { max-width: 980px; margin: 0 auto; padding: 0 28px 40vh; display: grid; gap: 22vh; }
.cr-intro { min-height: 90svh; display: grid; align-content: center; gap: 18px; color: var(--muted, #9c9488); font-size: 18px; max-width: 640px; }
.cr-intro h1 { margin: 0; color: var(--text, #f0ebe2); font: 700 clamp(48px, 8vw, 104px)/0.98 var(--font-display, system-ui, sans-serif); letter-spacing: -0.035em; }
.cr-intro p { margin: 0; }
figcaption { padding: 14px 4px 0; color: var(--muted, #9c9488); font-size: 14px; }
figcaption code { font-family: var(--font-mono, ui-monospace, monospace); color: var(--text, #f0ebe2); }
