/* ==========================================================================
   Pawse & Pages — scroll layout built from the Figma sketch (1280 x 3692)
   Standalone: does NOT depend on assets/css/main.css (Dimension template).
   ========================================================================== */

:root {
  /* Brand (carried over from style.css) */
  /* Brown from the app itself: every button and label in the booklet is
     #413530, measured off the Figma exports. The green is a muted sage
     rather than the app's brighter #6d902e toggle -- it sits quieter next
     to the paper texture. */
  --forest: #828e71;
  /* Sage is light: white on it is only 3.5:1 and it is 2.7:1 against the
     mist tag, both under AA. So the two places where green has to be READ
     rather than just seen -- white text on a green fill, green text on the
     tag -- use this darker sibling, which clears 5.6:1 and 4.5:1. Same
     hue, lower value; next to the fill the shift is barely visible. */
  --forest-ink: #5a6650;
  --sage: #a0a88a;
  --terracotta: #c4705a;
  --cream: #f6f1e5;

  /* Sketch neutrals */
  --paper: #f3f3f3; /* measured: rgb(243,243,243), neutral not warm */
  --paper-card: #fbfaf8;
  --ink: #413530;      /* the booklet's brown, not black */
  --ink-soft: #6b5c52;
  --line: #ddd6cc;     /* general hairlines stay warm grey */
  /* Sage is applied by hand, not through --line, so it lands only on the
     four things chosen for it: button borders, the note card, the dashed
     placeholder boxes, and the product's name in the About. Routing it
     through --line instead would have taken the nav's bottom line and
     every other hairline with it. */
  --sage-pale: #e9ecdf;
  --sage-hair: #cdd3c0;
  --panel: #828e71;    /* PDF-card backing, the sage */

  --serif: "DM Serif Text", Georgia, serif;
  --sans: "Sen", "Helvetica Neue", Arial, sans-serif;

  --nav-h: 68px;
  --container: 1080px;
  --gutter: 24px;
}

/* --- Paper background -------------------------------------------------- */
/* Two layers, split by spatial frequency, because a photo of paper cannot be
   tiled as-is: its edges do not wrap, and its creases would repeat visibly.

   images/paper-texture.png  grain only, 1000x1000, tiles seamlessly
   images/paper-creases.png  the folds, one sheet stretched over the whole page
   images/paper-source.jpg   the original photo, kept for regenerating these

   The split is what makes the repeat invisible: grain is stationary noise, so
   one tile is as good as another, while the creases are the part your eye
   would catch repeating -- and they never repeat, because that layer is drawn
   once at 100% of the page. */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--paper);
  /* Crease sheet on top, grain tile under it.
     - The tile was built by high-passing the photo (Gaussian sigma 24), which
       drops the folds and the camera's vignetting, then cross-fading a 100px
       margin around the wrap so opposite edges meet. Measured on the finished
       tile: the gradient across the seam is 1.00 horizontally and 1.86
       vertically, against 1.13 and 2.36 in the tile's interior -- the join is
       quieter than the paper itself, so there is nothing to see.
     - Normalised to mean luminance 243 / SD 4.48, matching the Figma
       screenshot (243 / 4.95). The photo's own grain is SD 2.5 on a darker
       223 base; it is amplified here to keep the page looking like the
       mockup. To soften it back toward the real sheet, rebuild the tile with
       a lower SD -- the colour is already right either way.
     - The crease layer sits on top as RGBA: black or white pixels carrying
       the exact alpha that lands each fold on its measured luminance over a
       243 base. Plain alpha compositing, no blend mode -- soft-light was the
       obvious choice but it compresses hard near white, turning a 14-unit
       fold into 1.3. Composited, this layer measures SD 1.71 against the
       photo's 1.68, range 229.7 to 247.8. 100% 100% stretches one sheet over
       the whole scroll, so the folds never repeat. */
  background-image:
    url("images/paper-creases.png"),
    url("images/paper-texture.png");
  background-size: 100% 100%, 1000px 1000px;
  background-repeat: no-repeat, repeat;
}

* { box-sizing: border-box; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --- Nav --------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 19px;
  text-decoration: none;
  white-space: nowrap;
}

.brand img { width: 26px; height: 26px; object-fit: contain; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
  font-size: 15px;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--terracotta);
}

/* --- Hero -------------------------------------------------------------- */
/* The collage is a 1280x760 stage. Percentages below are measured straight
   off the Figma screenshot, so the arrangement scales as a single unit
   instead of drifting as the viewport changes. */

.hero {
  position: relative;
  padding: 0 0 40px;
  /* The journal and the Past Pages screen deliberately sit near the frame
     edges; below 1280 they are cropped rather than widening the page. */
  overflow-x: hidden;
  overflow-x: clip;
}

.hero-stage {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 1280 / 760;
}

.piece {
  position: absolute;
  width: auto;
  height: auto;
  /* Each export carries its own shadow and rounded corners, so this stays
     unstyled: no background, no radius, no overflow clipping. */
}

/* left / top / width as % of the 1280 x 760 frame */
.piece-journal    { left:  5.00%; top: 23.82%; width: 11.80%; }
.piece-fungi      { left: 20.78%; top:  9.21%; width: 14.14%; }
.piece-crown      { left: 25.31%; top: 16.97%; width: 14.14%; z-index: 2; }
.piece-transcript { left: 53.05%; top:  5.00%; width: 20.16%; }
.piece-waveform   { left: 60.70%; top: 18.82%; width: 18.28%; z-index: 2; }
.piece-past       { left: 81.17%; top: 29.74%; width: 16.02%; }
/* Re-tuned after the walk-type export was replaced. The new one drops the
   "WALK TYPE" heading, so the piece is 27px shorter at the width it is drawn
   -- the REFLECTIVE card inside is the same size (47% of the piece either
   way), it just sits higher in a shorter box. The top moves down by the
   difference so the card lands where it did on the stage, and GO comes up to
   close the gap that opened under it. Measured, not eyeballed: the card's
   optical centre is within a pixel of where it was. */
.piece-walk       { left: 18.44%; top: 70.13%; width: 13.98%; }
.piece-go         { left: 27.27%; top: 77.40%; width: 12.97%; z-index: 2; }
.piece-canopy     { left: 65.94%; top: 66.84%; width: 21.56%; }
.piece-prompt     { left: 70.70%; top: 67.24%; width: 21.64%; z-index: 2; }

.hero-words {
  position: absolute;
  top: 37.89%;
  left: 0;
  right: 0;
  text-align: center;
}

.hero-title {
  /* 88px at the 1280 frame width; scales with the stage below that */
  font-size: min(6.875vw, 88px);
  line-height: 1.04;
  margin: 0;
}

.hero-sub {
  font-family: var(--serif);
  font-size: min(2.1vw, 27px);
  margin: 14px 0 0;
}

/* --- About ------------------------------------------------------------- */

.about {
  padding: 40px 0 120px;
}

/* The paragraphs are a centred column, not a left-hung one: the measure is
   capped at 680px and the leftover space is split evenly either side, while
   the text inside stays ranged left. Both paragraphs get the same cap, so
   they share one left edge rather than each centring on its own width.
   Below 680px + gutters the cap stops applying and the container's own
   padding takes over, so nothing needs undoing at phone width. */
.about .container { max-width: 980px; }

.about p {
  max-width: 680px;
  margin-inline: auto;
  text-align: left;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* The one piece of sage type on the page: the product's own name, where it
   is first said. This is #2F3E36 -- the exact green of the booklet frames in
   the feature shots, so the name and the frames are the same colour rather
   than two near-misses. Darker than --forest, which is too light to read at
   this size. */
.about strong { color: #2f3e36; font-weight: 700; }

/* Visible heading, set on the same 680px column as the paragraph so the
   two share a left edge. */
.about .section-head {
  max-width: 680px;
  margin: 0 auto 16px;
}

/* --- Feature rows ------------------------------------------------------ */

.feature {
  padding: 56px 0;
}

.feature .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.feature-text h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.22;
  margin-bottom: 18px;
}

.feature-text p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 34ch;
}

/* Each feature shows two states of the same screen: the one that is there at
   rest, and a second one that cross-fades in on hover. The exports carry the
   booklet frame themselves -- a deckled dark-green edge, drawn in Figma -- so
   this wrapper adds nothing of its own.

   The two images of a pair are the SAME CANVAS SIZE on purpose. The second is
   taken out of flow and laid exactly over the first, so the row's height comes
   from the first image alone and nothing reflows when the second fades in. If
   a future export changes size, the fade will start to shift the frame edge:
   match the canvas, do not patch it here. */
.feature-media { position: relative; }
.feature-media img { width: 100%; height: auto; display: block; }

.feature-media .media-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

/* focus-within costs nothing and means a keyboard user who tabs to something
   inside the media still gets the second state. */
.feature-media:hover .media-hover,
.feature-media:focus-within .media-hover { opacity: 1; }

/* Touch has no hover, so the second state would simply never be reachable --
   and a tap-to-swap would need an affordance saying so. Rather than leave a
   dead interaction, the pair alternates on its own, slowly, once the row is
   on screen. */
@media (hover: none) {
  .feature-media .media-hover {
    animation: media-alternate 9s ease-in-out infinite;
  }
}

@keyframes media-alternate {
  0%, 38%   { opacity: 0; }
  50%, 88%  { opacity: 1; }
  100%      { opacity: 0; }
}

/* A cross-fade is a change of opacity, not of position, so it is kept for
   reduced-motion -- but it happens at once rather than over half a second,
   and the unattended alternation on touch stops altogether. */
@media (prefers-reduced-motion: reduce) {
  .feature-media .media-hover { transition: none; animation: none; }
}

/* Alternating side: rows 1 and 3 put media on the right, row 2 on the left */
.feature--media-left .feature-media { order: -1; }

/* --- Note from the team ------------------------------------------------ */

.note {
  padding: 96px 0 120px;
}

.note-card {
  max-width: 580px;
  margin: 0 auto;
  /* No fill: the card is the paper itself, held by a hairline. */
  background: transparent;
  border: 1px solid var(--sage-hair);
  padding: 44px 48px 52px;
  box-shadow: 0 2px 0 rgba(65, 53, 48, 0.03);
}

.note-card h2 {
  text-align: center;
  font-size: 23px;
  margin-bottom: 26px;
}

.note-card p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.note-signoff { margin-top: 26px; }

/* --- Process ----------------------------------------------------------- */
/* Not drawn in the sketch, but the nav links to it and the original page
   has real content here, so it is carried over in the new visual language. */

.section-head {
  font-size: clamp(28px, 3.4vw, 40px);
  margin-bottom: 8px;
}

.section-intro {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 48px;
}

/* The team intro grew from five words to a short paragraph. It runs the full
   container on purpose, so its right edge lines up with the demo placeholder
   and the assignment grid below rather than stopping in the middle of the
   page and reading as though it had been cut off. That is a wider measure
   than is ideal for prose, so the line-height is opened up to compensate. */
.section-intro--long {
  max-width: none;
  line-height: 1.75;
  margin-bottom: 40px;
}

.section-intro--long strong { color: var(--ink); font-weight: 700; }

.process { padding: 40px 0 40px; }

/* Three across, each card stacking preview -> number -> title -> links.
   The markup is already in that order, so the card is a one-column grid and
   only the list around it changes. */
.assignments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
}

.assignment {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: start;
}

.assignment-media {
  background: var(--panel);
  padding: 8px;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(65, 53, 48, 0.13);
}

.slides-viewer,
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* The slide decks are shown as their rendered first page, not as a live PDF
   embed. The embed looked wrong and could not be made to look right: Chrome's
   built-in viewer picks its own zoom inside a 420px frame and lands the slide
   small in the top-left corner, and #view=FitH, #toolbar=0, #navpanes=0 and
   #scrollbar=0 all leave it exactly where it was. Other browsers each do
   something different again. The covers are already exact 16:9 renders of
   page one, so they fill the frame perfectly in every browser -- and dropping
   the embeds saves 12.5MB of PDF that used to download on every desktop
   visit. The whole deck is one click away, here or on the PDF button. */

.slides-cover {
  position: absolute;
  inset: 0;
  display: block;
}

.slides-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The frame is now a link with nothing to say so, so label it on approach. */
.slides-cue {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 11px;
  background: rgba(65, 53, 48, 0.88);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.02em;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.slides-cover:hover .slides-cue,
.slides-cover:focus-visible .slides-cue {
  opacity: 1;
  transform: none;
}

/* Touch has no hover: show it outright rather than never. */
@media (hover: none) {
  .slides-cue { opacity: 1; transform: none; }
}

.assignment-number {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 6px;
}

.assignment-info h3 {
  font-size: 19px;
  line-height: 1.3;
  margin-bottom: 14px;
}

.assignment-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-block;
  padding: 7px 15px;
  /* Full sage, not --line: a button should read as a control at rest, not
     as another hairline. The hover state deepens to --forest-ink so the
     white label stays legible. */
  border: 1px solid var(--forest);
  background: var(--paper-card);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

a.button:hover,
a.button:focus-visible {
  background: var(--forest-ink);
  border-color: var(--forest-ink);
  color: #fff;
}

/* TBD cards: buttons with no href are placeholders, not links */
.button:not([href]) {
  opacity: 0.45;
  cursor: default;
}

.button.is-loading { opacity: 0.6; cursor: progress; }

.assignment.is-tbd .assignment-media {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.tbd-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(130, 142, 113, 0.08);
  border: 1px dashed var(--sage-hair);
}

.tbd-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 9px;
  background: var(--mist, #e0e7d7);
  color: var(--forest-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* --- Demo -------------------------------------------------------------- */

.demo { padding: 96px 0 40px; }

.demo-placeholder {
  aspect-ratio: 16 / 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(130, 142, 113, 0.08);
  border: 1px dashed var(--sage-hair);
  color: var(--ink-soft);
  font-size: 14px;
}

/* --- Team -------------------------------------------------------------- */

.team { padding: 96px 0 40px; }

.members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
}

.member {
  text-align: center;
}

.members { align-items: start; }

.member .avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(65, 53, 48, 0.04);
  margin-bottom: 14px;
}

.member .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member h3 { font-size: 18px; margin-bottom: 2px; }

.member-role {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Secondary to the role list above it: what this person led. Smaller and
   lighter so the column reads name -> role -> detail at a glance, and the
   five cards stay scannable even though they no longer hold one word each.
   align-items: start on the row means a longer card cannot stretch the
   others; they simply end where they end. */
.member-led {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  opacity: 0.85;
}

/* --- Footer ------------------------------------------------------------ */

.site-footer {
  padding: 96px 0 56px;
  text-align: center;
}

.site-footer p {
  font-size: 13px;
  color: var(--ink-soft);
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 980px) {
  .assignments { grid-template-columns: repeat(2, 1fr); gap: 40px 28px; }
  .members { grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
}

@media (max-width: 760px) {
  :root { --nav-h: 60px; }

  .site-nav .container { gap: 16px; justify-content: space-between; }
  .nav-links { gap: 16px; font-size: 14px; }
  .brand span { display: none; }

  .assignments { grid-template-columns: 1fr; gap: 36px; }

  /* The collage stays, re-laid as a portrait stage: the same ten pieces,
     re-measured off the phone sketch onto a 401 x 645 frame instead of the
     1280 x 760 one. Everything below is a % of that frame, so the whole
     arrangement scales as a single unit exactly as it does on desktop, and
     the entrance animation and its scatter order are untouched.

     The stage is capped at 460px and centred: at the top of this breakpoint
     a full-width portrait frame would run over 1200px tall, so past 460 the
     collage stops growing and the margins take the extra width. */
  .hero { padding: 16px 0 24px; }

  .hero-stage {
    aspect-ratio: 401 / 645;
    max-width: 460px;
    /* the type below is sized in cqw so it tracks the stage, not the
       viewport -- once the stage is capped, the headline caps with it */
    container-type: inline-size;
  }

  /* left / top / width as % of the 401 x 645 portrait frame */
  .piece-prompt     { left: 55.4%; top:  1.6%; width: 38.9%; }
  .piece-canopy     { left: 55.4%; top:  4.7%; width: 38.9%; }
  .piece-walk       { left: 14.2%; top:  5.7%; width: 25.7%; }
  .piece-go         { left: 10.7%; top: 14.6%; width: 17.2%; }
  .piece-fungi      { left: 71.6%; top: 26.7%; width: 23.2%; }
  .piece-crown      { left:  5.0%; top: 59.9%; width: 23.7%; }
  .piece-past       { left: 59.1%; top: 59.9%; width: 25.7%; }
  .piece-journal    { left: 16.2%; top: 67.8%; width: 23.7%; }
  .piece-transcript { left: 49.9%; top: 85.6%; width: 31.2%; }
  .piece-waveform   { left: 65.3%; top: 90.2%; width: 29.4%; }

  .hero-words { top: 28.2%; }
  /* The name sets as two lines here, broken where the sketch breaks it --
     "Pawse" over "& Pages" -- rather than wherever the measure happens to
     run out. On desktop the span is an ordinary space and the line is one. */
  .hero-break { display: block; height: 0; }
  .hero-title { font-size: 18.5cqw; }
  .hero-sub   { font-size: 4.3cqw; margin-top: 10px; }
  .about { padding: 32px 0 64px; }

  .feature { padding: 36px 0; }
  .feature .container { grid-template-columns: 1fr; gap: 28px; }
  /* Media always above the text once stacked, whichever side it sat on */
  .feature-media { order: -1; }
  .feature-text p { max-width: none; }

  .note { padding: 56px 0 72px; }
  .note-card { padding: 32px 26px 38px; }

  .members { grid-template-columns: repeat(2, 1fr); }

  .demo, .team { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ==========================================================================
   MOTION & TYPE LAYER
   Added after the layout above, and gated so each piece can be switched off
   on its own. Every feature is scoped to a class on <body>:

     .fx-type       the type scale and tracking
     .fx-lift       white text-shadow behind type that sits over the paper
     .fx-entrance   the hero collage arriving in scattered order
     .fx-reveal     sections fading up as they enter the viewport
     .fx-focus      the feature row you are on stays lit, the others dim

   All five are on in index.html's <body class="...">. The panel in the
   corner flips them live and remembers the choice; to remove the panel for
   good, delete the FX PANEL block in script.js. To bake a decision in,
   drop the class from <body> (off) or remove the .fx-* prefix from the rules
   below (permanently on).
   ========================================================================== */

/* --- 1. Type scale ------------------------------------------------------ */
/* One tracking value, proportional to size, so the 88px headline reads tight
   without being hand-kerned. Line height falls as size rises. The sizes that
   were already right (hero 88/1.04, feature copy 15/1.7) are untouched; what
   changes is the tracking, the headings that were inheriting the body's 1.6,
   and the small type that needs tracking back the other way. */

body.fx-type { letter-spacing: -0.03em; }

/* Headings carry their own -0.01em in the block far above, which outranks the
   inherited value — so they have to be named, or the one place the trick is
   meant to show (the 88px hero) is the one place it never reaches. −0.03em on
   DM Serif Text at 88px is the whole point of the experiment; if it reads too
   tight, this is the line to soften rather than the body rule. */
body.fx-type h1,
body.fx-type h2,
body.fx-type h3,
body.fx-type h4 { letter-spacing: -0.03em; }

body.fx-type .section-head,
body.fx-type .feature-text h2 { line-height: 1.18; }
body.fx-type .note-card h2 { line-height: 1.25; }
body.fx-type h3 { line-height: 1.3; }

/* Line height only, no size. A blanket `p { font-size: 15px }` looks harmless
   but outranks the component rules above — .assignment-number (11px),
   .member-role (13px), .note-card p (14px) and the footer are all <p>, and a
   class selector loses to `body.fx-type p`. Every paragraph that carries body
   copy is already 15px; the size rule had nothing to add and four things to
   break. */
body.fx-type p { line-height: 1.7; }
body.fx-type .about p { line-height: 1.7; }

/* Small type goes the other way: at 13px and under, negative tracking closes
   the counters and the words start to clot, so it is handed back. */
body.fx-type .member-role,
body.fx-type .section-intro,
body.fx-type .site-footer p,
body.fx-type .button,
body.fx-type .demo-placeholder { letter-spacing: 0.01em; }

/* Caps labels go further still — they are set in tracking, not in size. */
body.fx-type .slides-cue { letter-spacing: 0.03em; }
/* .assignment-number and .tbd-tag already carry their own positive tracking. */

/* --- 2. Text over texture ----------------------------------------------- */
/* The paper is a photograph, so dark type lands on a surface that is never
   quite one value: creases run light and the grain runs both ways. A white
   shadow one or two pixels below the glyph lifts it off that surface. It is
   not a glow and should not read as one — at this opacity you only notice it
   by switching it off, when the headline suddenly sits *in* the paper rather
   than on it. Biggest effect on the largest type, which covers the most
   crease. */

body.fx-lift .hero-title,
body.fx-lift .hero-sub,
body.fx-lift .section-head,
body.fx-lift .feature-text h2 {
  text-shadow: 0 2px 2px rgba(255, 255, 255, 0.8);
}

/* --- 3. Hero entrance ---------------------------------------------------- */
/* One keyframe and a per-element delay held in a custom property; the browser
   does the rest. `backwards` holds each piece at opacity 0 during its delay,
   so nothing flashes in before its turn.

   The name lands first and alone, the line under it a beat later, and only
   then does the collage start arriving — so the page states what it is before
   it shows anything. The two words are animated separately rather than as one
   .hero-words block, which is what lets the subtitle trail the title.

   The pieces after them are scattered rather than sequential: read down the
   list and the arrival jumps across the frame — mid-left, far right, lower
   left, upper right — so the collage assembles rather than wiping in from one
   side. One rule is kept inside the scatter: a piece that sits on top of
   another always lands after it (go after walk, prompt after canopy, waveform
   after transcript; crown is under nothing). */

@keyframes lift-in {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0; }
}

body.fx-entrance .piece,
body.fx-entrance .hero-title,
body.fx-entrance .hero-sub {
  animation: lift-in 0.45s ease-out var(--enter-delay, 0s) backwards;
}

/* the words, first */
.hero-title       { --enter-delay: 0.00s; }
.hero-sub         { --enter-delay: 0.12s; }

/* then the collage, scattered */
.piece-crown      { --enter-delay: 0.30s; }
.piece-past       { --enter-delay: 0.37s; }
.piece-walk       { --enter-delay: 0.44s; }
.piece-transcript { --enter-delay: 0.51s; }
.piece-journal    { --enter-delay: 0.58s; }
.piece-canopy     { --enter-delay: 0.65s; }
.piece-fungi      { --enter-delay: 0.72s; }
.piece-prompt     { --enter-delay: 0.79s; }
.piece-waveform   { --enter-delay: 0.86s; }
.piece-go         { --enter-delay: 0.93s; }

/* --- 4. Scroll reveal ---------------------------------------------------- */
/* The reveal is a state, not an animation. One IntersectionObserver puts
   .rvg-in on a group; the children already carry .reveal and transition with
   a delay from --rd. One observer for the page, and the stagger is a class
   name rather than a timer.

   .js-reveal goes on <html> from the script, so if the script never runs the
   hidden state never exists and the page is simply visible — no blank
   sections if JS fails or is blocked. */

.js-reveal .reveal {
  opacity: 0;
  translate: 0 22px;
  scale: 0.965;
}

/* Two selectors: a .reveal inside a group that has turned on, and an element
   that is its own group (class="x rvg reveal") — used for the cards far down
   the page, which are taller than one screen as a set. */
.js-reveal .rvg-in .reveal,
.js-reveal .reveal.rvg-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition:
    opacity 0.55s ease,
    translate 0.7s cubic-bezier(0.2, 0.7, 0.25, 1),
    scale 0.7s cubic-bezier(0.2, 0.7, 0.25, 1);
  transition-delay: var(--rd, 0s);
}

.rv-1 { --rd: 0.12s; }
.rv-2 { --rd: 0.24s; }
.rv-3 { --rd: 0.36s; }

/* --- 5. Focus the row you are on ----------------------------------------- */
/* The feature rows sit in normal flow; the script marks whichever one is
   nearest the middle of the viewport. The others stay *visible* at low
   opacity rather than hidden, which is what makes the three screens read as
   one thing being leafed through instead of three separate sections. */

body.fx-focus .feature {
  transform-origin: 50% 50%;
  transition:
    opacity 0.35s ease,
    scale 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

body.fx-focus .feature:not(.is-active) {
  opacity: 0.2;
  scale: 0.82;
}

@media (max-width: 760px) {
  /* Scaling a stacked, full-width row down by a fifth leaves a visible gutter
     on both sides, so the dim is carried on opacity alone once the rows are
     the full width of the screen. */
  body.fx-focus .feature:not(.is-active) { opacity: 0.25; scale: 1; }
}

/* Reduced motion: the rule above this block already strips transitions, but
   the reveal's hidden state is not a transition — it has to be undone here or
   the page stays blank. Same for the entrance delays. */
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; translate: 0; scale: 1; }
  body.fx-entrance .piece,
  body.fx-entrance .hero-title,
  body.fx-entrance .hero-sub { animation: none; }
  body.fx-focus .feature:not(.is-active) { opacity: 1; scale: 1; }
}
