/* The landing page (home/index), linked only from it, after the Tailwind
   bundle. Plain CSS served by Propshaft as written.

   The month replicas animate through the small player at the end of
   home/index. The page renders every replica in its final state; the player
   arms a replica only when the browser allows motion, hiding what has not
   happened yet, and plays it once it scrolls into view:
   - [data-step="n"]  appears at step n (fades in, or with data-swap replaces
                      what stood there before, through the hidden attribute)
   - [data-before="n"] the earlier state, rendered hidden, shown until step n
   Without the script, or with reduced motion, nothing is armed and the reader
   sees the end of the story. */

@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/AlegreyaSans-Regular-dffb080c.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@layer components {
  /* The generated contracts are set in Alegreya Sans (Contracts::Renderer). */
  .story-paper {
    font-family: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  }

  [data-step] {
    transition: opacity 0.45s ease-out, transform 0.45s ease-out, background-color 1.2s ease-out;
  }

  [data-step].is-pending {
    opacity: 0;
    transform: translateY(6px);
  }

  /* A value that has just arrived lights up for a moment. */
  [data-step].is-lit {
    animation: story-lit 1.4s ease-out;
  }

  @keyframes story-lit {
    from { box-shadow: 0 0 0 4px rgb(191 219 254); }
    to { box-shadow: 0 0 0 4px rgb(191 219 254 / 0); }
  }

  /* A slot of the contract before its value is filled in: as wide as the
     value it waits for and inline like it, so no line moves when the value
     arrives. */
  .story-slot {
    padding: 0 0.25rem;
    white-space: nowrap;
    font-weight: 700;
    border-bottom: 1px dotted rgb(148 163 184);
    color: transparent;
  }

  /* One payment of the case study that FitByt could not pair. */
  .story-hatch {
    background-image: repeating-linear-gradient(135deg, rgb(148 163 184) 0 1.5px, transparent 1.5px 5px);
  }

  @media (prefers-reduced-motion: reduce) {
    [data-step] {
      transition: none;
    }
  }
}
