/* Round 6 — the whole story is one ordinary act: somebody opened a folder and
   looked inside. So the page is bare ground with one object on it that opens.
   Nothing else on this page has an edge. */

:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: Baskerville, "Hoefler Text", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --read: 1.1875rem;
  --hl: clamp(2.1rem, 5.6vw, 3.4rem);
  --measure: 37rem;
  --row: 3.5rem;

  --ground: #e8e1d4;
  --sheet: #fbf9f5;
  --ink: #1b1712;
  --muted: #5d5448;
  --rule: #c9bfae;
  --edge: #cdc2ae;
  --hot: #b4360c;
  --focus: #0b53d1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141210;
    --sheet: #1e1a16;
    --ink: #f0ebe3;
    --muted: #a99d8d;
    --rule: #3a332b;
    --edge: #2b251f;
    --hot: #ff7a45;
    --focus: #8fb4ff;
  }
}

/* ---- the ground -------------------------------------------------------- */

.scoop-substrate {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--read);
  line-height: 1.7;
}

.scoop-substrate a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.scoop-substrate a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.masthead {
  width: min(var(--measure), calc(100% - 2.5rem));
  min-height: 0;
  margin: 0 auto;
  padding: 1.7rem 0 1.5rem;
}

.scoop-substrate .masthead__link {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

main {
  display: block;
  padding-bottom: 3rem;
}

.sheet {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin: 0 auto;
}

/* ---- masthead of the story --------------------------------------------- */

.hl {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--hl);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.021em;
  text-wrap: balance;
}

/* The turn of the story is the second sentence, so it takes the one colour. */
.hl__turn {
  color: var(--hot);
}

.by,
.dl {
  margin: 1.6rem 0 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.dl {
  margin-top: 0.25rem;
  color: var(--muted);
}

/* ---- the body ---------------------------------------------------------- */

.body {
  margin-top: 2.4rem;
}

.body p {
  margin: 0 0 1.3em;
}

.body p:last-child {
  margin-bottom: 0;
}

/* The two quotations are the page's other voice. No box, no rule: they change
   face, because the only framed thing on this page is the folder. */
.body p.q {
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 1.24em;
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: -0.012em;
}

/* ---- the figure: the one object ---------------------------------------- */

.fig {
  margin: 2.6rem 0 0;
}

.still img {
  display: block;
  width: 100%;
  height: auto;
}

.fig figcaption {
  margin-top: 1.1rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.rig {
  display: none;
}

.rig:not([hidden]) {
  display: block;
}

/* three moments, named in plain words */
.moments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
}

.moment {
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.moment[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* The window. The only edge on the page, and a hard offset behind it, the way
   two plates print out of true. */
.win {
  background: var(--sheet);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 var(--edge);
}

.win__bar {
  display: flex;
  align-items: stretch;
  min-height: var(--row);
  border-bottom: 2px solid var(--rule);
}

.up {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: 0.35rem 0 0.35rem 0.4rem;
  padding: 0 0.7rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.up[disabled] {
  color: var(--muted);
  opacity: 0.45;
  cursor: default;
}

.path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0.5rem 0.9rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.path__sep {
  color: var(--muted);
  font-weight: 400;
}

/* The deck holds one listing at a time. Its height is fixed at three rows, so
   opening a folder never moves the page under the reader. */
.win__deck {
  position: relative;
  height: calc(3 * var(--row));
  perspective: 900px;
  overflow: hidden;
}

.list {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--sheet);
  transform-style: preserve-3d;
}

/* Going in: the new listing arrives from the right and settles forward; the one
   you left drops back and away. The gesture is the one every file list uses. */
.list--in {
  animation: in 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.list--out {
  animation: out 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.list--in-back {
  animation: inback 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.list--out-back {
  animation: outback 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes in {
  from { transform: translateX(22%) translateZ(-90px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes out {
  from { transform: none; opacity: 1; }
  to { transform: translateX(-9%) translateZ(-140px); opacity: 0; }
}

@keyframes inback {
  from { transform: translateX(-9%) translateZ(-140px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes outback {
  from { transform: none; opacity: 1; }
  to { transform: translateX(22%) translateZ(-90px); opacity: 0; }
}

.list li {
  display: block;
  height: var(--row);
  border-bottom: 1px solid var(--rule);
}

.list li:last-child {
  border-bottom: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  height: 100%;
  padding: 0 0.9rem;
  background: transparent;
  color: var(--ink);
  border: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

button.row:hover {
  background: var(--ground);
}

span.row {
  cursor: default;
}

/* Colour has one job on this page: it marks the 190 GB. A row that holds the
   company's work is vermilion. An empty listing has no colour in it at all. */
.row--work {
  color: var(--hot);
}

.row__go {
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
}

.row__meta {
  flex: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.empty {
  display: flex;
  align-items: center;
  height: var(--row);
  margin: 0;
  padding: 0 0.9rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 1rem;
}

.win__status {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.55rem;
  align-items: baseline;
  min-height: var(--row);
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-top: 2px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.win__status b {
  color: var(--hot);
  font-weight: 600;
}

.done {
  margin: 1.1rem 0 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
}

.done[hidden] {
  display: none;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- foot -------------------------------------------------------------- */

.rule {
  width: min(var(--measure), calc(100% - 2.5rem));
  height: 0;
  margin: 3rem auto 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.mw {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin: 2.2rem auto 0;
}

.reaction-assembly,
.reaction-response,
.share-control {
  font-family: var(--sans);
}

.mw nav {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.mw nav a {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.base-matter {
  margin-top: 2rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
}

/* ---- the handover: the next story opens the way a folder does ----------- */

/* An in-flow stage at the document's foot: a deeper plane the last stretch of
   scroll crosses. Scroll position alone drives it, on any input. */
.tstage {
  position: relative;
  overflow: hidden;
  margin-top: 3rem;
  min-height: 88vh;
  min-height: 88dvh;
  background: var(--edge);
  border-top: 2px solid var(--ink);
}

.tstage__nb {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  padding: 2rem clamp(1.25rem, 6vw, 4rem);
  background: var(--sheet);
  border-left: 2px solid var(--ink);
}

/* The same move the listing makes when the reader opens a folder: the next
   story's sheet slides in from the right as the reader scrolls to the end. */
.tstage--live .tstage__nb {
  transform: translateX(calc((1 - var(--t, 0)) * 102%));
}

.transition-neighbour__masthead {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.tstage__nb a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
}

.tstage__nb span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.tstage__nb strong {
  font-family: var(--sans);
  font-size: var(--hl);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.021em;
}

/* ---- tiers ------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .list--in,
  .list--out,
  .list--in-back,
  .list--out-back {
    animation: none;
  }

  .tstage--live .tstage__nb {
    transform: none;
  }
}

/* The reaction bar carries its own fixed width; below 360px the closing block
   runs to the page gutter so the bar lands square. */
@media (max-width: 22.5rem) {
  .mw {
    width: calc(100% - 2rem);
  }
}

@media (max-width: 34rem) {
  :root {
    --row: 3.25rem;
  }

  .win {
    box-shadow: 5px 5px 0 var(--edge);
  }

  .row,
  .path,
  .empty {
    font-size: 0.9375rem;
  }
}
