/* MythKite Animation: mythkite.com
   The design is written down in DESIGN.md, one folder up.

   Colour: every colour on the page is sampled from the intro itself: the painted dusk sky, the cream of the
   lettering and the kite's papers. (Osama's call, 2 December 2026: no navy and amber. These replace the
   brand book's Dusk page colours on the website; the logo files are untouched.)
   Type, spacing and corners are the brand tokens (Brand/MythKite brand book/project/tokens.json).

   Movement: every animation sits behind "html.motion", which the page only sets for visitors who have not
   asked their device for less motion. Without it the page is still. */

:root {
  /* colour, from the intro's painting */
  --ground: #6a517a;        /* the plum shadow side of the clouds: the page */
  --surface: #7a598b;       /* the mauve of the middle sky: cards */
  --ink: #faf1de;           /* the cream of the lettering */
  --ink-soft: #e2d6ff;      /* captions and labels */
  --glow: #e3a788;          /* the peach of the horizon: hover, focus, one link */
  --glow-light: #ebb791;    /* the brightest part of the horizon */
  --on-glow: #363c6c;       /* the top of the sky: text on cream or peach */
  --gold: #ffd680;          /* the dust around the kite */
  --paper: #fffcf4;         /* the kite */
  --paper-shade: #dad6e6;
  --crease: #9a6986;        /* the rose of the clouds: 1px lines */
  --sky-1: #3a3d74;         /* the sky in the film, top to horizon */
  --sky-2: #554e89;
  --sky-3: #6b538c;
  --sky-4: #8b6287;
  --sky-5: #c48082;
  --sky-6: #e3a788;
  --story-scifi: #68aab6;   /* the kite's three story papers */
  --story-comedy: #f8be68;
  --story-horror: #28204e;

  /* type */
  --display: "Fraunces", Georgia, serif;
  --text: "Figtree", system-ui, sans-serif;
  --label: "Josefin Sans", "Century Gothic", sans-serif;

  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;

  /* corners */
  --radius-fold: 2px;
  --radius-card: 8px;
  --radius-pill: 999px;

  --gutter: var(--space-3);
  --page: 1080px;
  --band: 120px;     /* room kept for the tagline and the links */
  --bar: 56px;       /* height of the bar that appears after the opening */
}

@media (min-width: 720px) {
  :root { --gutter: var(--space-5); }
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ground); -webkit-text-size-adjust: 100%; }
html.motion { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--bar) + var(--space-3)); }

body {
  margin: 0;
  /* paper grain over the page colour, as in the film */
  background: var(--ground) url("assets/grain.png");
  color: var(--ink);
  font: 400 17px/27px var(--text);
  overflow-x: hidden;
}

img, video, iframe { display: block; max-width: 100%; }
h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

/* ------------------------------------------------------------------ type styles */

.heading { font: 600 32px/38px var(--display); }
.subheading { font: 600 22px/28px var(--display); }
.small { font: 400 14px/21px var(--text); color: var(--ink-soft); }

.eyebrow, .button, .link, .chip, .genre {
  font: 600 13px/16px var(--label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow { color: var(--ink-soft); margin-bottom: var(--space-2); }

/* ------------------------------------------------------------------ links and buttons */

/* The one button. */
.button {
  display: inline-block;
  padding: 15px var(--space-4) 13px;
  /* the wide letter-spacing leaves a gap after the last letter; this evens the two sides */
  padding-right: calc(var(--space-4) - 0.24em);
  border-radius: var(--radius-pill);
  background: var(--ink);       /* cream paper, like the kite and the lettering */
  color: var(--on-glow);
  text-decoration: none;
}
.button:hover { background: var(--glow-light); }
.button:active { transform: translateY(1px); }
.button[aria-disabled="true"] { background: var(--surface); color: var(--ink-soft); pointer-events: none; }

.link {
  display: inline-block;
  padding: 15px 0 13px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: var(--ink-soft);
}
.link:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }

.text-link {
  color: var(--glow);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration-thickness: 2px; }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--ground);
  color: var(--ink);
  border-radius: var(--radius-fold);
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------------ the bar */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar);
  padding: 0 var(--gutter);
  background: var(--ground) url("assets/grain.png");
  border-bottom: 1px solid var(--crease);
  transform: translateY(-100%);
  visibility: hidden;
}
html.nav-on .nav { transform: none; visibility: visible; }
/* it folds down in four drawings */
html.motion .nav { transition: transform 0.16s steps(4), visibility 0s 0.16s; }
html.motion.nav-on .nav { transition: transform 0.16s steps(4), visibility 0s; }

.nav-mark { display: block; margin-left: -3px; }
.nav-mark img { width: 96px; height: auto; }
.nav-links { display: flex; gap: var(--space-4); }
.nav-links .link { text-decoration-color: transparent; }
.nav-links .link:hover { text-decoration-color: var(--ink); }

/* ------------------------------------------------------------------ 1. the opening
   The painting is the page. It runs edge to edge from the top, and its foot dissolves into the page colour.
   The film is a window inside the painting, with soft edges, so there is no box to see. The tagline and the
   links sit where the painting has dissolved.

   --h   the height of the film's frame on this screen
   --top how far the frame is lifted above the top of the page (the film's top is empty sky)
   --at  where the tagline starts, as a share of --h                                              */

.hero {
  position: relative;
  overflow: hidden;
  /* wide film, 16:9: as tall as fits with the words under it, and never so wide the logo is cut */
  --shape: wide;
  --h: min((100vh - var(--band)) / 0.94, 90.9vw);
  --h: min((100svh - var(--band)) / 0.94, 90.9vw);
  --top: calc(var(--h) * -0.09);
  --at: 1.03;
  --frame-w: calc(var(--h) * 16 / 9);
  --scene-w: calc(var(--frame-w) * 1.2469);
  --scene-h: calc(var(--h) * 1.2463);
  --plate: url("assets/sky-wide.jpg");
  --foot: linear-gradient(to bottom, #000 76%, transparent 85%);   /* where the painting dissolves into the page */
  --sides: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
  min-height: max(100vh, calc(var(--top) + var(--h) * var(--at) + var(--band)));
  min-height: max(100svh, calc(var(--top) + var(--h) * var(--at) + var(--band)));
}

/* The backdrop runs the full width of the page and holds the sky. Its foot dissolves into the page. */
.backdrop {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--top);
  height: var(--scene-h);
  overflow: hidden;
  -webkit-mask-image: var(--foot);
  mask-image: var(--foot);
}

/* The painting. In the wide film it is a quarter larger than the film's frame: more sky to the sides, and
   the mountains below. */
.scene, .backdrop::before, .backdrop::after {
  position: absolute;
  top: 0;
  width: var(--scene-w);
  height: 100%;
}
.scene {
  left: 50%;
  transform: translateX(-50%);
  /* its sides are soft, so on a very wide window it blends into the sky that carries on beside it */
  -webkit-mask-image: var(--sides);
  mask-image: var(--sides);
  background:
    var(--plate) center / 100% 100% no-repeat,
    linear-gradient(to bottom, var(--sky-1) 0%, var(--sky-2) 24%, var(--sky-3) 40%, var(--sky-4) 56%, var(--sky-5) 72%, var(--sky-6) 80%);
}
/* On a window wider than the painting, the sky carries on to both edges: the same painting again on each
   side, tucked under the painting's soft sides so one blends into the next with no line and no mirror. */
.backdrop::before, .backdrop::after {
  content: "";
  background: var(--plate) center / 100% 100% no-repeat;
}
.backdrop::before { left: calc(50% - var(--scene-w) * 1.40); }
.backdrop::after { left: calc(50% + var(--scene-w) * 0.40); }
/* order, back to front: the side sky, the painting, the logo and the words */
.scene { z-index: 1; }
.stage, .band, .intro-controls { z-index: 2; }

/* The film's frame inside the painting. */
.frame {
  position: absolute;
  left: 9.9%;
  top: 0;
  width: 80.2%;
  height: 80.24%;
}

.intro {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  pointer-events: none;
  /* soft edges: the film melts into the painting around it */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(to bottom, #000 93%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(to bottom, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* The still logo, laid over the frame exactly where the film leaves it. */
.stage {
  position: absolute;
  left: 50%;
  top: var(--top);
  width: var(--frame-w);
  height: var(--h);
  transform: translateX(-50%);
  pointer-events: none;
}
.lockup {
  position: absolute;
  left: 22.24%;
  top: 12.5%;
  width: 55%;
}
.lockup img { width: 100%; height: auto; }

/* tall film, 9:16, for phones: the frame is the whole painting, as wide as the screen */
@media (max-aspect-ratio: 7 / 10) {
  .backdrop::before, .backdrop::after { content: none; }   /* the tall painting already fills the width */
  .hero {
    --shape: tall;
    /* at least as wide as the screen; taller screens get a larger frame, up to where the logo would be cut */
    --h: clamp(177.78vw, (100vh - var(--band)) / 0.86, 234vw);
    --h: clamp(177.78vw, (100svh - var(--band)) / 0.86, 234vw);
    --frame-w: calc(var(--h) * 9 / 16);
    --scene-w: var(--frame-w);
    --scene-h: var(--h);
    --plate: url("assets/sky-tall.jpg");
    --foot: linear-gradient(to bottom, #000 74%, transparent 86%);
    --sides: linear-gradient(#000, #000);
    --at: 0.86;
    /* lifted only as far as needed to keep the words on the first screen */
    --top: clamp(var(--h) * -0.22, 100vh - var(--h) * 0.86 - var(--band), 0px);
    --top: clamp(var(--h) * -0.22, 100svh - var(--h) * 0.86 - var(--band), 0px);
  }
  .scene {
    background-image:
      var(--plate),
      linear-gradient(to bottom, var(--sky-1) 0%, var(--sky-2) 30%, var(--sky-3) 50%, var(--sky-4) 62%, var(--sky-5) 70%, var(--sky-6) 80%);
  }
  .frame { left: 0; width: 100%; height: 100%; }
  .intro { -webkit-mask-image: none; mask-image: none; }
  .lockup { left: 14.11%; top: 34.66%; width: 71.11%; }
}

/* While the intro is loading or playing, the still logo waits out of sight. */
html[data-intro="pending"] .lockup,
html[data-intro="playing"] .lockup { opacity: 0; }
html[data-intro="playing"] .intro { opacity: 1; }
html.motion .lockup { transition: opacity 0.3s linear; }
html.motion[data-intro] .lockup { transition: none; }
html.motion .intro { transition: opacity 0.5s linear; }
html.motion[data-intro="playing"] .intro { transition-duration: 0.4s; }

.intro-controls {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
}

.chip {
  min-height: 44px;
  padding: 2px var(--space-3) 0;
  padding-right: calc(var(--space-3) - 0.24em);
  border: 1px solid var(--crease);
  border-radius: var(--radius-fold);
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-soft); }
.chip:active { transform: translateY(1px); }
.chip:disabled { color: var(--ink-soft); cursor: default; }
.chip[hidden] { display: none; }
/* Where a cursor can start the intro by itself, the button only shows for keyboard users. */
.chip.quiet:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ 2. the tagline and the links */

/* FOR NOW the site is the opening alone. Everything marked "later" (the bar, the genre line, Films, About,
   the footer) is built and waiting: to show it all, change data-show="opening" to data-show="all" at the
   very top of index.html. */
html[data-show="opening"] .later { display: none !important; }

.band {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--top) + var(--h) * var(--at));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--gutter);
  text-align: center;
}

.tagline { font: 600 22px/28px var(--display); }

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 var(--space-4);
}
@media (max-width: 560px) {
  /* on a phone the tagline stays on one line and the links on one row */
  .band { padding: 0 var(--space-2); }
  .links { gap: 0 var(--space-3); }
}

/* ------------------------------------------------------------------ the genre line */

.genres {
  overflow: hidden;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--crease);
  border-bottom: 1px solid var(--crease);
}
.genres-track { display: flex; width: max-content; max-width: 100%; }
.genres-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) 0;
  padding: 0 var(--gutter);
  font: 600 32px/38px var(--display);
}
.genres-list li { display: flex; align-items: center; white-space: nowrap; }
/* the kite flies between the words */
.genres-list li::after {
  content: "";
  flex: none;
  width: 24px;
  height: 40px;
  margin: 0 var(--space-4);
  background: url("assets/mythkite-kite-dusk.svg") center / contain no-repeat;
}
.genres-list:not(.loop) li:last-child::after { display: none; }

/* moving: one long row, doubled by site.js, sliding left for ever */
html.motion .genres-track.loop { max-width: none; animation: genres 48s linear infinite; }
html.motion .genres-track.loop .genres-list { flex-wrap: nowrap; padding: 0; }
html.motion .genres-track.loop:hover,
html.motion .genres-track.loop:focus-within { animation-play-state: paused; }
html:not(.motion) .genres-list[aria-hidden="true"] { display: none; }
@keyframes genres { to { transform: translateX(-50%); } }

/* still (less motion asked for): a tidy list on a phone */
@media (max-width: 719px) {
  html:not(.motion) .genres-list { font: 600 22px/28px var(--display); }
  html:not(.motion) .genres-list li::after { width: 14px; height: 24px; margin: 0 var(--space-3); }
}

@media (min-width: 720px) {
  .genres { padding: var(--space-5) 0; }
  html.motion .genres-track.loop .genres-list { font: 600 56px/60px var(--display); letter-spacing: -0.01em; }
  html.motion .genres-track.loop li::after { width: 34px; height: 56px; margin: 0 var(--space-5); }
}

/* ------------------------------------------------------------------ sections */

.section {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) 0;
}

.section .heading { margin-bottom: var(--space-4); }

/* ------------------------------------------------------------------ 3. the films */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
}

.player-frame, .player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* The note covers the frame until there is a film to show. */
.player-note {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--surface);
  text-align: center;
}
.player-art { position: relative; height: 30%; min-height: 72px; max-height: 150px; aspect-ratio: 235 / 393; }
.player-art img { width: 100%; height: 100%; }
.player-note-text p + p { margin-top: var(--space-1); }
.player-note-text p:last-child { margin-top: var(--space-2); }
.player[data-state="ready"] .player-note { display: none; }
.player[data-state="loading"] .player-frame { visibility: hidden; }

@media (max-width: 560px) {
  /* a little more room for the words on a phone */
  .player[data-state="loading"], .player[data-state="empty"], .player[data-state="offline"] { aspect-ratio: 4 / 3; }
}

/* gold dust around the kite */
.dust i {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0.7;
}
.dust i:nth-child(1) { left: -46%; top: 6%; }
.dust i:nth-child(2) { left: 128%; top: 0%; width: 11px; height: 11px; }
.dust i:nth-child(3) { left: -72%; top: 38%; width: 5px; height: 5px; }
.dust i:nth-child(4) { left: 150%; top: 34%; width: 6px; height: 6px; }
.dust i:nth-child(5) { left: -34%; top: 64%; width: 10px; height: 10px; }
.dust i:nth-child(6) { left: 118%; top: 70%; width: 5px; height: 5px; }
.dust i:nth-child(7) { left: 40%; top: -22%; width: 6px; height: 6px; }

/* the kite bobs on twos: 32 drawings in 2.7 seconds */
html.motion .player-art img { animation: bob 2.667s infinite; animation-timing-function: steps(4); }
@keyframes bob {
  0%    { transform: translateY(0);      animation-timing-function: steps(4); }
  12.5% { transform: translateY(-0.9px); animation-timing-function: steps(4); }
  25%   { transform: translateY(-3px);   animation-timing-function: steps(4); }
  37.5% { transform: translateY(-5.1px); animation-timing-function: steps(4); }
  50%   { transform: translateY(-6px);   animation-timing-function: steps(4); }
  62.5% { transform: translateY(-5.1px); animation-timing-function: steps(4); }
  75%   { transform: translateY(-3px);   animation-timing-function: steps(4); }
  87.5% { transform: translateY(-0.9px); animation-timing-function: steps(4); }
  100%  { transform: translateY(0); }
}
html.motion .dust i { animation: twinkle 2.4s steps(6) infinite; }
html.motion .dust i:nth-child(2) { animation-duration: 3.1s; animation-delay: -0.8s; }
html.motion .dust i:nth-child(3) { animation-duration: 2.0s; animation-delay: -1.3s; }
html.motion .dust i:nth-child(4) { animation-duration: 2.8s; animation-delay: -0.4s; }
html.motion .dust i:nth-child(5) { animation-duration: 3.4s; animation-delay: -2.1s; }
html.motion .dust i:nth-child(6) { animation-duration: 2.2s; animation-delay: -1.7s; }
html.motion .dust i:nth-child(7) { animation-duration: 2.9s; animation-delay: -0.2s; }
@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.film-grid[hidden] { display: none; }

.film {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.film-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.film-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* under a cursor the corner of the paper folds over */
.film-thumb::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  background: linear-gradient(to bottom left, var(--ground) 50%, var(--paper-shade) 50%);
}
.film:hover .film-thumb::after, .film:focus-visible .film-thumb::after { width: 28px; height: 28px; }
html.motion .film-thumb::after { transition: width 0.125s steps(3), height 0.125s steps(3); }
.film-title {
  display: block;
  margin-top: var(--space-2);
  font: 600 22px/28px var(--display);
}
.film:hover .film-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.film[aria-current="true"] .film-thumb { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ------------------------------------------------------------------ about */

.prose { max-width: 65ch; }
.prose p + p { margin-top: var(--space-3); }

@media (min-width: 880px) {
  .about {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-5);
    align-items: start;
  }
  .about .heading { margin-bottom: 0; }
  .about .prose { padding-top: calc(16px + var(--space-2)); }
}

.shapes-heading { margin-top: var(--space-6); margin-bottom: var(--space-4); }
.shapes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
@media (min-width: 720px) { .shapes { gap: var(--space-4); } }
.shape img { width: 100%; height: auto; border-radius: var(--radius-fold); }
.shape figcaption { margin-top: var(--space-3); }
.shapes-note { margin-top: var(--space-4); max-width: 65ch; }

/* a genre label: its paper colour, with the word beside it */
.genre {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 12px 5px;
  padding-right: calc(12px - 0.24em);
  border: 1px solid var(--crease);
  border-radius: var(--radius-pill);
  color: var(--ink);
}
.genre::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: -2px;
  transform: rotate(45deg);
}
.genre-scifi::before { background: var(--story-scifi); }
.genre-comedy::before { background: var(--story-comedy); }
.genre-horror::before { background: var(--story-horror); outline: 1px solid var(--paper); }

@media (max-width: 560px) {
  /* three across on a phone: the labels shrink to the swatch above the word */
  .genre { flex-direction: column; gap: 6px; padding: 0; border: 0; letter-spacing: 0.12em; }
  .shape figcaption { margin-top: var(--space-2); text-align: center; }
  .genre::before { margin-top: 2px; }
}

/* ------------------------------------------------------------------ footer */

.footer { margin-top: var(--space-6); }

/* The six sky colours, top to horizon, as flat bands. */
.dusk-rule span { display: block; height: 3px; }
.dusk-rule span:nth-child(1) { background: var(--sky-1); }
.dusk-rule span:nth-child(2) { background: var(--sky-2); }
.dusk-rule span:nth-child(3) { background: var(--sky-3); }
.dusk-rule span:nth-child(4) { background: var(--sky-4); }
.dusk-rule span:nth-child(5) { background: var(--sky-5); }
.dusk-rule span:nth-child(6) { background: var(--sky-6); }

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--gutter);
  text-align: center;
}
.footer-mark { width: 144px; height: auto; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--space-4); }

/* ------------------------------------------------------------------ arriving on screen
   Words arrive in the warm light and settle to ink, left to right, as the name is written in the intro.
   Paper unfolds from its centre crease in six drawings. Running copy fades in. */

html.motion [data-settle] .w { opacity: 0; color: var(--glow); }
html.motion [data-settle].in .w {
  opacity: 1;
  color: var(--ink);
  transition: opacity 80ms linear calc(var(--i) * 70ms), color 360ms linear calc(var(--i) * 70ms + 120ms);
}

html.motion [data-fold] { clip-path: inset(0 50%); }
html.motion [data-fold].in { clip-path: inset(0 0); transition: clip-path 250ms steps(6) calc(var(--i, 0) * 110ms); }

html.motion [data-fade] { opacity: 0; }
html.motion [data-fade].in { opacity: 1; transition: opacity 600ms linear; }

/* ------------------------------------------------------------------ less motion, when asked for */

@media (prefers-reduced-motion: reduce) {
  html:not(.motion) *, html:not(.motion) *::before, html:not(.motion) *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
