/* The scroll stories and the words of TESORIN's home page and Apricity's
   (story-wheel.js).

   The phone beside a story turns by itself: the scroll chooses which part
   is showing, and the phone goes through that part's screens one after
   another, a second each (the user, 20 Nov 2026: "now auto move all the
   pictures and video not with scrolls, every 1 second"). A screen comes in
   from the left and pushes the last out at the right. The words stand
   still, every line in its place and in full ink, and every block of words
   on the page comes in a line at a time as it enters the window (the last
   part of this file).

   Until then (19 and 20 Nov) a part held in place while the page scrolled
   through it and the screens moved with the scroll; before that the lines
   rolled like a picker's drum, which these files are named for. Without
   script the first screen stands and the list is plain. */

/* No part is set back while another is in view: every part's words stand
   in full ink (story.css dims the ones that aren't current; the user wants
   no muted text). */
.story[data-wheel].is-enhanced .story__step {
  opacity: 1;
  transition: none;
}

/* The phone's screens, a part's and the pages within one: the one marked
   is-on shows; the script marks the one coming in (is-in) and the one
   going out (is-out), and they cross the phone together, left to right.

   A page that shows takes its screen's visibility; it never says "visible"
   itself, or the first page of every other part's screen would show
   through its hidden screen (the last part's stood over the phone). A page
   that has gone out simply stays off to the right, where the phone's
   screen clips it. */
.story[data-wheel].is-timed .story__screen {
  opacity: 1;
  visibility: hidden;
  transition: none;
}

.story[data-wheel].is-timed .story__screen.is-on {
  visibility: visible;
}

.story[data-wheel].is-timed .home-screen--pages .home-screen__page {
  opacity: 1;
  visibility: hidden;
  transition: none;
}

.story[data-wheel].is-timed .home-screen--pages .home-screen__page:is(.is-on, .is-out) {
  visibility: inherit;
}

.story[data-wheel].is-timed .home-screen--pages .home-screen__page.is-out {
  transform: translate3d(100%, 0, 0);
}

@media (prefers-reduced-motion: no-preference) {
  .story[data-wheel].is-timed :is(.story__screen, .home-screen__page).is-in {
    animation: screen-in .55s cubic-bezier(.3, .7, .2, 1) both;
  }

  .story[data-wheel].is-timed .story__screen.is-out {
    visibility: visible;
    animation: screen-out .55s cubic-bezier(.3, .7, .2, 1) both;
  }

  .story[data-wheel].is-timed .home-screen__page.is-out {
    animation: page-out .55s cubic-bezier(.3, .7, .2, 1) both;
  }
}

@keyframes screen-in {
  from { transform: translate3d(-100%, 0, 0); }
  to { transform: none; }
}

@keyframes screen-out {
  from { transform: none; visibility: visible; }
  to { transform: translate3d(100%, 0, 0); visibility: hidden; }
}

@keyframes page-out {
  from { transform: none; }
  to { transform: translate3d(100%, 0, 0); }
}

/* The words stand in front of the phone's backdrop of sky, which is wider
   than the phone's column and fades out over the edge of theirs: behind
   it, the first letters of a heading were washed pale (the stage comes
   later in the page, so it was drawn over them). On a narrow screen the
   stage stays in front, where the words scroll under the pinned phone. */
@media (min-width: 1000px), (min-width: 760px) and (min-aspect-ratio: 1251/1000) and (min-height: 640px) {
  .story[data-wheel] .story__steps {
    position: relative;
    z-index: 1;
  }
}

/* A step's lines are set large enough to read at a glance beside the phone
   (the user, 20 Nov 2026: "can we please increase size of the text"), on
   both home pages, whether the step holds or scrolls by. */
.story[data-wheel] .story__list {
  max-width: 30em;
  font-size: clamp(21px, 1.9vw, 25px);
  line-height: 1.38;
}

.story[data-wheel] .story__list .story__icon {
  height: 1.38em;
}

.story[data-wheel] .story__list .story__icon svg {
  width: 23px;
  height: 23px;
}

.story[data-wheel] .story__list > li {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 14px;
}

/* The list: a plain list, each line in its place and in the page's full
   ink, none set back; nothing moves. */
.story__list.wheel-list {
  gap: 6px;
  color: var(--ink);
}

.story__list.wheel-list > li.wheel-line {
  display: block;
}

/* A line is a button the width of its line, laid out as the line was;
   pressing it takes the page to its screen. */
.wheel-line__pick {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 5px 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-wrap: pretty;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wheel-line__pick .story__icon {
  color: inherit;
}

.wheel-line__pick:focus-visible {
  outline: 2px solid var(--accent-olive, #737C47);
  outline-offset: 4px;
}

/* Only where the phone is pinned above the words (story.css's narrow
   layout) are the lines smaller, for the room there is under it. (These
   sizes once followed a rule that also took in any upright window up to
   1100px wide: the user's own window was one, and got a phone's small
   text beside the phone.) */
@media (max-width: 759.98px), (max-width: 999.98px) and (max-aspect-ratio: 5/4), (max-width: 999.98px) and (max-height: 639.98px) {
  .story[data-wheel] .story__list {
    font-size: 17.5px;
    line-height: 1.36;
  }

  .story[data-wheel] .story__list .story__icon svg {
    width: 20px;
    height: 20px;
  }

  .story[data-wheel] .story__list > li {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
  }

  .story__list.wheel-list {
    gap: 2px;
  }

  .wheel-line__pick {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    padding: 4px 0;
  }
}

/* --------------------------------------------------------------------------
   The words, a line at a time (story-wheel.js, part 2). The script puts a
   block's words in spans and numbers the line each falls on (--ln); when
   the block enters the window (is-in) each line fades in after the one
   above it, --ln-gap apart, where it stands, and the block itself comes up
   a few pixels as they do. --ln-at holds a block back until the blocks
   above it that arrived with it have had their lines; --ln-from is the
   line that comes first (the last one, when the block comes down out of
   the top). Nothing is hidden until the script has measured (ln-ready), so
   without it, and with Reduce Motion, the words simply stand.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  /* The pace is the Otalo site's (the user's own, which they pointed to
     as the motion closest to the recording's; its styles.css .reveal): a
     block comes up 22px as it fades in over .65s on the plain ease, the
     next .12s after it. Here it is each line that waits its turn, and the
     block that rises. */
  html.ln-ready .ln {
    transform: translate3d(0, 22px, 0);
    transition: transform .65s ease var(--ln-at, 0ms);
  }

  html.ln-ready .ln.is-in {
    transform: none;
  }

  html.ln-ready .ln .ln-w,
  html.ln-ready .ln--solid {
    opacity: 0;
  }

  html.ln-ready .ln.is-in .ln-w {
    animation: ln-in .65s ease both;
    animation-delay: calc(var(--ln-at, 0ms) + max(var(--ln, 0) - var(--ln-from, 0), var(--ln-from, 0) - var(--ln, 0)) * var(--ln-gap, 120ms));
  }

  html.ln-ready .ln--solid.is-in {
    animation: ln-in .65s ease both;
    animation-delay: var(--ln-at, 0ms);
  }

  /* A part that came up with the scroll as one piece leaves that to its
     lines (below, and bright.css's own reveal where a browser can't tie
     one to the scroll). */
  :is(body.home-page, body.apricity-home) main [data-reveal].ln-group {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

@keyframes ln-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   The rest of both home pages (TESORIN's and Apricity's): what comes into
   view comes with the scroll, not on a clock, and both ways. Scrolling
   down, a part rises and clears as it comes up from the window's foot, and
   eases up and away as it goes under the top; scrolling back up it comes
   down out of the top the same way and sinks back at the foot (the user,
   19 Nov 2026: "scroll up effect should be also good like scroll down").
   It had only the first half, so a part met again from above simply stood
   there. Where a browser can't tie an animation to the scroll, the site's
   own reveal stands (bright.css).
   -------------------------------------------------------------------------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :is(body.home-page, body.apricity-home) main [data-reveal] {
      opacity: 1;
      transform: none;
      transition: none;
      animation-name: page-rise, page-leave;
      animation-duration: auto, auto;
      animation-timing-function: linear, linear;
      /* (The leaving only holds once it has begun, so before then the
         rising one is what shows.) */
      animation-fill-mode: both, forwards;
      animation-timeline: view(), view();
      animation-range: entry 0% cover 26%, exit 40% exit 100%;
    }
  }
}

@keyframes page-rise {
  from { opacity: 0; transform: translate3d(0, 34px, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes page-rise-far {
  from { opacity: 0; transform: translate3d(0, 70px, 0) scale(.94); }
  to { opacity: 1; transform: none; }
}

@keyframes page-leave {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translate3d(0, -28px, 0); }
}
