/* The reality today: the interruptions you already make. Below 961px it is a
   plain stepped list of the fifteen; above, a pinned passage that flies the
   reader through a deep field of them (js/phrase-focus.js). */
.reality {
  padding: var(--section-y) var(--gutter);
}

.reality__copy {
  position: relative;
}

/* The blunt red fragment out of the page edge, in the family of the Next
   report tab, carries the section's name. */
.reality__tag {
  display: inline-block;
  height: 2.4rem;
  margin-left: calc(-1 * var(--gutter));
  padding: 0 2.75rem 0 var(--gutter);
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.15rem) 100%, 0 100%);
  line-height: 2.4rem;
  color: var(--white);
}

.reality__tag::after {
  content: none;
}

.phrases {
  list-style: none;
}

.phrase {
  font-family: var(--serif);
  letter-spacing: -0.02em;
}

/* Line breaks are fixed in markup; the second line steps in under the quote. */
.phrase > span {
  display: block;
}

.phrase > span + span {
  padding-left: 0.5em;
}

/* Stacked, the fifteen run as five groups of three: an anchor and two quieter
   replies, close together, with a longer pause between groups. The groups
   swing left and right, and the last ends on a second anchor. The tagged
   fifteen are the list's first children; the crowd after them is hidden. */
@media (max-width: 960px) {
  .phrases {
    display: grid;
    gap: 0.9rem;
    margin-top: clamp(3rem, 8vw, 4.5rem);
  }

  .phrase {
    font-size: clamp(1.375rem, 5.9vw, 1.875rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
  }

  .phrase:nth-child(3n + 1),
  .phrase:nth-child(15) {
    font-size: clamp(1.75rem, 7.8vw, 2.5rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
  }

  .phrase:nth-child(3n + 4) {
    margin-top: clamp(1.75rem, 7vw, 2.75rem);
  }

  .phrase:nth-child(n + 4):nth-child(-n + 6),
  .phrase:nth-child(n + 10):nth-child(-n + 12) {
    justify-self: end;
  }
}

/* The phone field's track and window exist only on phones (below);
   everywhere else they are transparent to layout. */
.reality__field,
.reality__window {
  display: contents;
}

/* Phones without the script or with reduced motion: five groups of three, a
   field ruled off by group. Each group's first quote is its anchor, set
   larger behind a fine ink rule; the two replies hang under it on the same
   inset. Every quote runs the full measure, so its markup line break gives
   way. */
@media (max-width: 767px) {
  /* The demo's own foot opens the gap above. */
  .reality {
    padding-top: 0;
  }

  .phrases {
    gap: 0;
    margin-top: 2rem;
  }

  .phrase,
  .phrase:nth-child(15) {
    margin-top: 0.5rem;
    padding-left: calc(1rem + 2px);
    font-size: 1.1875rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .phrase > span {
    display: inline;
  }

  .phrase > span + span {
    padding-left: 0;
  }

  .phrase:nth-child(3n + 1) {
    margin-top: 0;
    padding-left: 1rem;
    border-left: 2px solid var(--ink);
    font-size: 1.75rem;
    line-height: 1.12;
    letter-spacing: -0.02em;
  }

  .phrase:nth-child(3n + 4) {
    margin-top: 1.5rem;
  }

  .phrase:nth-child(n + 4):nth-child(-n + 6),
  .phrase:nth-child(n + 10):nth-child(-n + 12) {
    justify-self: auto;
  }

  .phrase:nth-child(3n):not(:nth-child(15)) {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
  }
}

/* Phones with js/phrase-focus.js running (it sets .is-pocket): a pinned
   window the reader flies through, the thirty phrases passing once each. The
   track gives the pin its scroll; the window holds under the bar, centred in
   the screen below it, and clips whatever flies past its edges. Its haze is
   pale grey at the vanishing point and paper at the rim, so it reads as depth
   rather than a box. The script sets each phrase's size, place, blur and
   fade. */
@media (max-width: 767px) {
  .reality.is-pocket .reality__field {
    --field-h: min(31.25rem, calc(100svh - var(--bar-h) - 2.5rem));
    display: block;
    height: calc(var(--field-h) + 125svh);
    margin: 2rem calc(-1 * var(--gutter)) 0;
  }

  .reality.is-pocket .reality__window {
    position: sticky;
    top: calc(var(--bar-h) + (100svh - var(--bar-h) - var(--field-h)) / 2);
    display: block;
    height: var(--field-h);
    overflow: hidden;
    background: radial-gradient(ellipse 75% 60% at 50% 42%, #e7e6e2, var(--paper));
  }

  .reality.is-pocket .phrases {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    margin: 0;
  }

  .reality.is-pocket .phrase {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    line-height: 1.04;
    letter-spacing: -0.02em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    will-change: transform, opacity, filter;
  }

  .reality.is-pocket .phrase > span {
    display: block;
  }

  .reality.is-pocket .phrase > span + span {
    padding-left: 0.5em;
  }

  .reality.is-pocket .phrase--crowd {
    color: var(--ink-soft);
  }

  /* The desktop field's three voices, dealt once per visit. */
  .reality.is-pocket .phrase--italic {
    font-style: italic;
    font-weight: 400;
  }

  .reality.is-pocket .phrase--caps {
    font-family: var(--sans);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .reality.is-pocket .phrase--caps > span + span {
    padding-left: 0;
  }
}

/* The crowd only exists for the depth of the desktop field. */
.phrase--crowd {
  display: none;
}

/* How Frank files it, shown under the phrase in focus. */
.phrase::after {
  display: none;
}

@media (min-width: 961px) {
  /* The pinned stretch the reader flies through. Its sides clip here, so a
     phrase blowing past the camera never makes the page scroll sideways. */
  .reality {
    height: calc(100svh - var(--bar-h) + 110svh);
    padding: 0;
    overflow-x: clip;
  }

  /* Unclipped top and foot, so no phrase is ever cut on a straight line:
     pinned, the top bar covers what rises past it; arriving, it drifts a short
     way up into the demo, the script fading whatever rises further; leaving,
     it runs on under How Frank works,
     whose rising top edge masks it on the slant. */
  .reality__stage {
    position: sticky;
    top: var(--bar-h);
    height: calc(100svh - var(--bar-h));
  }

  .reality__copy {
    position: absolute;
    z-index: 1;
    top: 12%;
    left: var(--gutter);
    width: min(35rem, 44vw);
  }

  /* The field's vanishing point sits right of centre, away from the copy; the
     script leans it a little towards the pointer. */
  .phrases {
    --vx: 64%;
    --vy: 46%;
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    perspective: 1000px;
    perspective-origin: var(--vx) var(--vy);
  }

  /* Every phrase hangs from the vanishing point; the script sets its place in
     depth, its blur and its fade. */
  .phrase,
  .phrase--crowd {
    position: absolute;
    top: var(--vy);
    left: var(--vx);
    display: block;
    font-size: min(3.5vw, 6.8svh);
    line-height: 1.04;
    white-space: nowrap;
    opacity: 0;
    will-change: transform, opacity, filter;
  }

  /* Three voices, dealt at random as each phrase comes round again. */
  .phrase--italic {
    font-style: italic;
    font-weight: 400;
  }

  .phrase--caps {
    font-family: var(--sans);
    font-size: min(1.45vw, 2.8svh);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .phrase--caps > span + span {
    padding-left: 0;
  }

  .phrase[data-verdict]::after {
    content: attr(data-verdict) '  \00b7  ' attr(data-rubric);
    display: block;
    margin-top: 1.1rem;
    padding-left: 0.12rem;
    font: 500 0.75rem/1 var(--mono);
    font-style: normal;
    letter-spacing: 0.04em;
    text-transform: none;
    white-space: pre;
    color: var(--ink-mute);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
  }

  .phrase.is-active::after {
    opacity: 1;
  }
}
