/* Process page, #metric, direction A "The bend". PROPOSED (Claude, art director A, 2026-10-29).
   Loaded after process-mass.css. Scoped to .mass-a; the rest of the page is untouched.

   The picture: one field of bone pen lines on ink, bent toward a dark centre that is not drawn. One warm
   light from the top-right corner lands on the well's far wall. Nothing else is drawn: Ryan, Oct 29, 17:49,
   "i dont like the random line and dot... it does not really say what you think its saying." The free path,
   the rust point, the cross and the rings are removed; the bend, fully formed while the H2 is on screen, is
   the rest state.
   Desktop: the art pins beside the copy (CSS sticky) and scroll position sets the bend.
   Phone: the art is a band under the H2 and scrubs as it passes.
   With no JavaScript, or with reduced motion, every layer sits in its resting state. */

/* The one rule outside the section. styles.css gives body overflow-x: hidden, which makes body a scroll
   container and stops every position: sticky on the page from pinning. clip keeps the horizontal clip
   without creating a scroll container. Browsers without overflow: clip keep hidden and simply do not pin. */
@supports (overflow: clip) {
  body[data-page="process"] { overflow-x: clip; }
}

section.mass-a {
  --ma-ink: #090909;
  --ma-bone: #ece9e1;
  --ma-cream: #c9b894;
  --ma-rust: #ef322d;
  --ma-rule: rgba(236, 233, 225, 0.14);
  position: relative;
  padding: 0 !important;
  background: var(--ma-ink) !important;
  border-top: 0 !important;
  isolation: isolate;
}

/* The page's corner "+" marks are rust marks with no job in this section: not here. */
.mass-a .section-mark { display: none !important; }

/* The ladder's old pieces never show here. */
.mass-a .process-ladder__rungs,
.mass-a .process-ladder__names { display: none; }

/* The italic word: cream, and no highlighter swipe (styles.css draws a rust marker under every em). */
.mass-a em {
  color: var(--ma-cream) !important;
  -webkit-text-fill-color: var(--ma-cream) !important;
  font-style: italic;
  font-weight: 500;
}
.mass-a em::after,
.mass-a em::before {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* ---------- the pin ---------- */
.mass-a__pin {
  position: relative;
}

.mass-a__stage {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
  /* The site nav is an opaque bar over the top of the viewport. The art fades out below it so the bar never
     slices the field. --ma-top is the nav's bottom edge in stage coordinates (JS keeps it there while the
     stage pins and releases); without JS it sits at the nav's height, which is right while pinned. */
  --ma-top: 80px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent var(--ma-top), #000 calc(var(--ma-top) + 12vh));
          mask-image: linear-gradient(to bottom, transparent 0, transparent var(--ma-top), #000 calc(var(--ma-top) + 12vh));
}

.mass-a__art {
  position: absolute;
  top: 50%;
  right: 0;
  width: max(100%, 160vh);
  aspect-ratio: 1440 / 900;
  transform: translateY(-50%);
}

.mass-a__art > picture,
.mass-a__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.mass-a__art img {
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

/* Resting state (no JS, reduced motion, and the end of the bend): fully bent and lit. */
.mass-a__field { opacity: 0; }
.mass-a__field[data-k="6"] { opacity: 1; }
.mass-a__ground--lit { opacity: 1; }
/* Until the end-state plates decode, the light waits, so a fast scroll never shows the copper light with no
   field lines in it. */
.mass-a--live.mass-a--loading .mass-a__ground--lit { opacity: 0 !important; }

.mass-a--live .mass-a__field,
.mass-a--live .mass-a__ground--lit { will-change: opacity; }

/* ---------- copy over the pinned stage ---------- */
.mass-a__copy {
  position: relative;
  z-index: 1;
  margin-top: -100vh;
  margin-top: -100svh;
  padding-top: clamp(200px, 29vh, 300px);
  padding-bottom: clamp(300px, 50vh, 520px);
}

.mass-a__head {
  max-width: min(41vw, 620px);
}

.mass-a .process-kicker {
  margin: 0 0 30px;
}

.mass-a h2 {
  margin: 0;
  max-width: 9.4em;
  font-family: var(--f-display, 'Inter Tight', system-ui, sans-serif);
  font-size: clamp(52px, 6.3vw, 104px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.052em;
  word-spacing: 0.06em;
  color: var(--ma-bone);
  text-wrap: balance;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "ss01" 0;
}

.mass-a__intro {
  max-width: 28.5em;
  margin: clamp(120px, 18vh, 190px) 0 0;
  font-family: var(--f-body, 'Inter', system-ui, sans-serif);
  font-size: clamp(17px, 1.32vw, 20px);
  line-height: 1.64;
  letter-spacing: -0.003em;
  color: rgba(236, 233, 225, 0.76);
  text-wrap: pretty;
}

/* The band is the phone's version of the stage. */
.mass-a__band { display: none; }

/* ---------- after the pin: the drivers and the note, on clean ink ---------- */
.mass-a__after {
  position: relative;
  z-index: 1;
  padding-top: clamp(40px, 5vw, 72px);
  /* with Groundwork's own top padding this leaves about 20% of a viewport of clean ink before its head */
  padding-bottom: clamp(24px, 2.5vw, 36px);
}

.mass-a__drivers {
  list-style: none;
  margin: 0;
  padding: clamp(30px, 3.2vw, 44px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  border-top: 1px solid var(--ma-rule);
}

.mass-a__drivers li {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mass-a__index {
  font-family: var(--f-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  color: rgba(236, 233, 225, 0.74);
}

.mass-a__name {
  margin-top: 22px;
  font-family: var(--f-display, 'Inter Tight', system-ui, sans-serif);
  font-size: clamp(28px, 2.5vw, 38px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.034em;
  color: var(--ma-bone);
}

.mass-a__q {
  margin-top: 14px;
  max-width: 21em;
  font-family: var(--f-body, 'Inter', system-ui, sans-serif);
  font-size: clamp(15px, 1.12vw, 17px);
  line-height: 1.5;
  color: rgba(236, 233, 225, 0.66);
  text-wrap: pretty;
}

.mass-a__note {
  /* The section's last beat and its joke: a closing line in the display face, not a footnote. */
  max-width: 34em;
  margin: clamp(88px, 9vw, 136px) 0 0;
  padding-top: 0;
  border-top: 0;
  font-family: var(--f-display, 'Inter Tight', system-ui, sans-serif);
  font-size: clamp(22px, 1.9vw, 28px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.018em;
  word-spacing: 0.02em;
  text-transform: none;
  color: rgba(236, 233, 225, 0.9);
  text-wrap: balance;
}

/* ---------- variant for Ryan's photography call (?print=1): one borderless print in the empty ink ---------- */
.mass-a__print { display: none; }
.mass-a--print .mass-a__print {
  display: block;
  /* left on the copy column, so its right edge stays well clear of where the field starts (x 660 at 1440) */
  width: min(30vw, 420px);
  margin: clamp(64px, 9vh, 96px) 0 0;
}
.mass-a__print img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ---------- tablet: same pin, the art moves further right ---------- */
@media (max-width: 1180px) and (min-width: 901px) {
  .mass-a__head { max-width: 46vw; }
  .mass-a__intro { max-width: 27em; }
  .mass-a__drivers { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

/* ---------- phone and small tablet: the art becomes a band under the H2 ---------- */
@media (max-width: 900px) {
  .mass-a__stage { display: none; }

  .mass-a__copy {
    margin-top: 0;
    padding-top: clamp(76px, 18vw, 110px);
    padding-bottom: 0;
  }

  .mass-a__head { max-width: none; }

  .mass-a .process-kicker { margin-bottom: 22px; }

  .mass-a h2 {
    max-width: 10.5em;
    font-size: clamp(42px, 11.6vw, 72px);
    line-height: 0.96;
    letter-spacing: -0.048em;
  }

  .mass-a__band {
    display: block;
    position: relative;
    width: 100vw;
    max-width: 640px;
    margin: clamp(18px, 5vw, 32px) 0 0 calc(-1 * var(--ma-gutter, 20px));
    aspect-ratio: 390 / 440;
    overflow: hidden;
    /* the corner light enters from just outside the band; feather its top and bottom so no edge shows */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 92%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 92%, transparent 100%);
  }

  .mass-a__art--band {
    top: 0;
    right: auto;
    left: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    transform: none;
  }

  .mass-a__intro {
    max-width: 34em;
    margin-top: clamp(14px, 4vw, 28px);
    font-size: 17px;
    line-height: 1.62;
  }

  .mass-a__after {
    padding-top: clamp(56px, 14vw, 80px);
    padding-bottom: clamp(56px, 14vw, 80px);
  }

  .mass-a__drivers {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 34px;
  }

  .mass-a__name { margin-top: 14px; font-size: 30px; }
  .mass-a__q { margin-top: 10px; font-size: 16px; }

  .mass-a__note { margin-top: 64px; font-size: 22px; }

  .mass-a--print .mass-a__print { width: 86%; margin: 40px 0 0 auto; }
}

@media (max-width: 900px) and (min-width: 640px) {
  .mass-a__band { margin-left: auto; margin-right: auto; width: 100%; }
}
