/* Robots’ Last Exam — homepage, tasks set beside the real world (home-reality.js).

   A wide clip is one picture: the real recording left of a boundary, the simulation right of it, and the
   boundary follows the pointer. An upright clip stands as two halves instead, real beside simulation, which
   together fill the same frame as a wide clip. */

/* The reading layouts share the Tasks text grid, including its mobile gutter. */
.rle-home {
  --chapter-left: calc(var(--rail) + var(--pad));
  --chapter-right: clamp(32px, 4vw, 72px);
  --chapter-title-size: clamp(32px, min(3.4vw, 6.2vh), 60px);
  --chapter-title-gap: clamp(12px, 2.2vh, 22px);
  --chapter-inset: clamp(22px, 4svh, 48px);
}
@media (max-width: 900px) {
  .rle-home { --chapter-right: var(--pad); }
}

/* A sheet with rounded top corners, laid over the end of the row of scenes before it. */
.tasks {
  margin-top: -34px; border-radius: 34px 34px 0 0; box-shadow: 0 -26px 70px rgba(0,0,0,.38);
  --tasks-rule: color-mix(in srgb, var(--ink) 20%, transparent);
  position: relative; z-index: 1; min-height: 100vh;
  display: grid; grid-template-columns: minmax(300px, .6fr) minmax(0, 1.4fr); column-gap: clamp(36px, 4.4vw, 84px); align-items: center;
  padding: calc(var(--top) + 5vh) var(--chapter-right) 7vh var(--chapter-left);
  background: var(--paper); color: var(--ink);
}
.tasks-copy .display { margin-top: var(--chapter-title-gap); font-size: var(--chapter-title-size); }
.tasks-copy .lede { max-width: 21em; margin-top: 2.4vh; font-size: clamp(15px, min(1.3vw, 2.3vh), 21px); color: color-mix(in srgb, var(--ink) 76%, transparent); }

.tasks-list { list-style: none; margin: 4vh 0 0; padding: 0; border-top: 1px solid var(--tasks-rule); }
.tasks-item {
  position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; width: 100%;
  padding: clamp(9px, 1.5vh, 16px) 0; border: 0; border-bottom: 1px solid var(--tasks-rule); background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; opacity: .46; transition: opacity .3s ease;
}
.tasks-item:hover, .tasks-item:focus-visible, .tasks-item.is-active { opacity: 1; }
.tasks-item .eyebrow { padding-top: 5px; }
.tasks-item strong { display: block; font: 600 clamp(16px, min(1.3vw, 2.5vh), 21px)/1.15 var(--display); letter-spacing: -.014em; }
.tasks-item small { display: block; margin-top: 4px; font-size: 13px; color: color-mix(in srgb, var(--ink) 70%, transparent); }
/* How far the clip has played, along the rule under its name. */
.tasks-item::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px; background: var(--ink); transform: scaleX(var(--played, 0)); transform-origin: 0 50%; opacity: 0; }
.tasks-item.is-active::after { opacity: 1; }

.tasks-view { display: grid; justify-items: center; align-content: center; row-gap: 16px; min-width: 0; }
/* home-reality.js sets the box's width and height: the clip's own shape, as large as the column allows. */
.compare {
  position: relative; overflow: hidden; border-radius: 14px; background: #000000; cursor: ew-resize;
  box-shadow: 0 30px 70px rgba(0,0,0,.22); user-select: none; -webkit-user-select: none; touch-action: pan-y;
  transition: width .55s cubic-bezier(.2, .7, .2, 1), height .55s cubic-bezier(.2, .7, .2, 1);
}
.compare:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.compare canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* The boundary: --at is its place across the picture, 0 … 1. */
.compare-edge { position: absolute; top: 0; bottom: 0; left: calc(var(--at, .5) * 100%); width: 0; pointer-events: none; }
.compare-edge::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--cream); box-shadow: 0 0 16px rgba(0,0,0,.45); }
.compare-knob {
  position: absolute; top: 50%; left: 0; display: grid; place-items: center; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%; background: var(--cream); color: var(--ink); box-shadow: 0 6px 22px rgba(0,0,0,.4);
  font: 500 15px/1 var(--sans); letter-spacing: 2px; text-indent: 2px;
}
.compare-tag {
  position: absolute; bottom: 14px; padding: 7px 9px 6px; border-radius: 3px; background: rgba(0,0,0,.62); color: var(--cream);
  font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; pointer-events: none;
}
/* Each label fades when its side of the picture is nearly gone. */
.compare-tag--real { left: 14px; opacity: clamp(0, (var(--at, .5) - .1) * 12, 1); }
.compare-tag--sim { right: 14px; opacity: clamp(0, (.9 - var(--at, .5)) * 12, 1); }
/* Upright clips: the two recordings side by side, a seam between them, nothing to move. */
.compare--side { cursor: default; }
.compare--side .compare-edge { left: 50%; }
.compare--side .compare-edge::before { left: -2px; width: 4px; background: var(--paper); box-shadow: none; }
.compare--side .compare-knob { display: none; }
.compare--side .compare-tag { opacity: 1; }
.tasks-note { min-height: 1.3em; font-size: 13px; color: color-mix(in srgb, var(--ink) 66%, transparent); }

@media (max-width: 900px) {
  .tasks { display: block; min-height: 0; padding-right: var(--pad); }
  .tasks-view { margin-top: 36px; }
}
