/* The scene below the hero: the wall of questions, then one lesson between two hands, then the wall turned over
   (js/tutor.js). Everything here is the scene as it runs; the foot of the file is the page standing still. */
.tutor { position: relative; background: var(--night); }
.tu-stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.tu-still { display: none; }
.tu-wall { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the lesson's window: a Mac window (its place and size are set by the script), the sheet scrolling inside it */
.tu-win { position: absolute; left: 0; top: 0; overflow: hidden; border-radius: 13px; background: #fbf8f1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 44px 110px rgba(0, 0, 0, 0.66), 0 16px 36px rgba(0, 0, 0, 0.46); }
.tu-win::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34); }
.tu-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; height: var(--bar, 38px); padding: 0 14px;
  background: linear-gradient(#f6f3ec, #e8e4db); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 0 rgba(0, 0, 0, 0.1), 0 8px 14px -10px rgba(0, 0, 0, 0.3); }
.tu-bar i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2); }
.tu-bar i:nth-child(2) { background: #febc2e; }
.tu-bar i:nth-child(3) { background: #28c840; }
.tu-bar span { position: absolute; left: 70px; right: 70px; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font: 600 13px/1.3 var(--sans); letter-spacing: -0.005em; color: #716b63; }
.tu-sheet { display: block; }
/* the window and the tab behind its edge share one tilt */
.tu-desk { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; will-change: transform; }
/* the backdrop goes quiet under the words while the lesson's on */
.tu-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(11, 8, 6, 0.94), rgba(11, 8, 6, 0.86) 38%, rgba(11, 8, 6, 0.5) 62%, rgba(11, 8, 6, 0.3)); }
/* the head and foot of the window fall off into the dark behind the sheet */
.tu-vig { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(var(--night), transparent 14%, transparent 86%, var(--night)); }
/* whose hand it is, on a tab that sticks out from behind the window at the line being written */
.tu-tab { position: absolute; left: 0; top: 0; display: flex; align-items: center; height: 34px; padding: 2px 30px 0 15px; border-radius: 4px 0 0 4px; font: 400 19px/1 var(--tutor); white-space: nowrap;
  opacity: 0; transition: opacity 0.3s; will-change: transform; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.tu-tab.astor { background: #1e1e1e; color: #fbf8f1; }
.tu-tab.astor b { margin-left: 7px; font-weight: 400; font-size: 0.8em; color: var(--orange); }
.tu-tab.you { background: #2a4b9b; color: #fbf8f1; }
.tu-tab.on { opacity: 1; }
.tu-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 46% 40% at 50% 50%, rgba(8, 6, 5, 0.86), rgba(8, 6, 5, 0.42) 62%, transparent 82%); }

.tu-words { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; pointer-events: none; }
.tu-words > div { grid-area: 1 / 1; padding: 0 24px; opacity: 0; }
.tu-words h2, .tu-end h2 { margin: 0; font: 440 clamp(54px, 8.6vw, 150px)/0.94 var(--mast); font-variation-settings: "opsz" 144, "SOFT" 100; letter-spacing: -0.025em; color: var(--cream);
  text-shadow: 0 4px 60px rgba(5, 4, 7, 0.9), 0 0 120px rgba(5, 4, 7, 0.9); }
.tu-words .kicker { color: var(--cream); opacity: 0.8; text-shadow: 0 1px 14px #000; }
.tu-words p.sub, .tu-end p.sub { max-width: 30em; margin: 22px auto 0; font: 400 clamp(18px, 1.5vw, 22px)/1.5 var(--body); color: var(--dim); text-shadow: 0 1px 18px rgba(5, 4, 7, 0.95); text-wrap: balance; }

/* beside the sheet: whose hand it is, and what's happening */
.tu-side { position: absolute; z-index: 5; left: clamp(28px, 6vw, 112px); top: 0; bottom: 0; width: min(37vw, 540px); display: flex; flex-direction: column; justify-content: center;
  pointer-events: none; opacity: 0; }
.tu-who { display: none; gap: 10px; margin: 0 0 clamp(22px, 3.4vh, 38px); }
.tu-chip { padding: 9px 15px 7px; border-radius: 2px; background: #fbf8f1; font: 400 19px/1 var(--tutor); opacity: 0.26; transform-origin: 50% 100%;
  transition: opacity 0.45s, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.tu-chip.astor { color: #1e1e1e; }
.tu-chip.you { color: #2a4b9b; }
.tu-side[data-who="astor"] .tu-chip.astor, .tu-side[data-who="you"] .tu-chip.you { opacity: 1; transform: translateY(-3px) rotate(-2deg); }
.tu-caps { position: relative; min-height: clamp(250px, 36vh, 380px); list-style: none; margin: 0; padding: 0; }
.tu-cap { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(14px); transition: opacity 0.4s, transform 0.5s; }
.tu-cap.on { opacity: 1; transform: none; transition-delay: 0.12s; }
.tu-cap .n { margin: 0 0 18px; font: 500 11.5px/1.4 var(--futura); letter-spacing: 0.3em; text-transform: uppercase; color: var(--cyan); }
.tu-cap h3 { margin: 0 0 20px; font: 440 clamp(42px, 4.9vw, 84px)/0.97 var(--mast); font-variation-settings: "opsz" 144, "SOFT" 100; letter-spacing: -0.022em; color: var(--cream); }
.tu-cap p:last-child { margin: 0; max-width: 21em; font: 400 clamp(17px, 1.4vw, 21px)/1.5 var(--body); color: var(--dim); text-wrap: pretty; }
/* the exchange as a line passing between the two of them */
.tu-track { display: block; width: min(100%, 324px); height: auto; margin-top: clamp(18px, 3vh, 34px); overflow: visible; }
.tu-track text { font: 500 9.5px/1 var(--futura); letter-spacing: 0.24em; text-transform: uppercase; fill: rgba(251, 248, 242, 0.62); }
.tu-track text.y { fill: #8fb0ff; }
.tu-track path, .tu-track circle { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tu-track .rail { stroke: rgba(251, 248, 242, 0.13); stroke-width: 1; stroke-dasharray: 1 5; }
.tu-track .go.a { stroke: var(--cream); }
.tu-track .go.y { stroke: #8fb0ff; }
.tu-track .head { fill: var(--cream); stroke: none; }
.tu-track .head.y { fill: #8fb0ff; }
.tu-track .off { stroke: #ff5a64; opacity: 0; transition: opacity 0.35s; }
.tu-track .on { stroke: #4fd08a; stroke-width: 2; opacity: 0; transition: opacity 0.35s; }
.tu-track.off .off, .tu-track.on .on { opacity: 1; }

/* the way out */
.tu-end { position: absolute; z-index: 6; left: clamp(28px, 6vw, 112px); top: 0; bottom: 0; width: min(40vw, 580px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  opacity: 0; pointer-events: none; }
.tu-end.live { pointer-events: auto; }
.tu-live .tu-end:not(.live) .pill { visibility: hidden; }
/* (the wall behind is paper by now: the words keep a dark of their own) */
.tu-end::before { content: ""; position: absolute; z-index: -1; inset: 0 -22vw 0 -12vw; pointer-events: none;
  background: radial-gradient(ellipse 62% 56% at 36% 50%, rgba(11, 8, 6, 0.93), rgba(11, 8, 6, 0.8) 46%, rgba(11, 8, 6, 0) 76%); }
.tu-end h2 { font-size: clamp(52px, 6.6vw, 112px); }
.tu-end p.sub { margin: 22px 0 30px; }

@media (max-width: 899px) {
  .tu-tab { display: none; }
  .tu-win { border-radius: 11px; }
  .tu-bar { gap: 6px; padding: 0 11px; }
  .tu-bar i { width: 10px; height: 10px; }
  .tu-bar span { left: 58px; right: 58px; font-size: 11.5px; }
  .tu-words h2 { font-size: clamp(38px, 11.4vw, 54px); }
  .tu-shade { background: rgba(11, 8, 6, 0.72); }
  .tu-side { left: 0; right: 0; bottom: auto; width: auto; padding: 62px 20px 10px; justify-content: flex-start; background: var(--night); box-shadow: 0 10px 18px 6px var(--night); }
  .tu-who { display: flex; margin-bottom: 14px; }
  .tu-chip { padding: 7px 12px 5px; font-size: 16px; }
  .tu-caps { min-height: 118px; }
  .tu-cap .n { margin-bottom: 8px; font-size: 10.5px; }
  .tu-cap h3 { margin-bottom: 8px; font-size: 31px; line-height: 1; word-spacing: 0.08em; }
  .tu-cap h3 br { display: none; }
  .tu-cap p:last-child { font-size: 15.5px; line-height: 1.4; }
  .tu-track { display: none; }
  .tu-end { left: 0; right: 0; bottom: auto; width: auto; padding: 74px 22px 26px; align-items: center; text-align: center; }
  .tu-end::before { inset: 0 0 -40px 0; background: linear-gradient(rgba(11, 8, 6, 0.95) 72%, rgba(11, 8, 6, 0)); }
  .tu-end h2 { font-size: 46px; }
  .tu-end h2 br { display: none; }
  .tu-end p.sub { margin: 12px auto 18px; font-size: 16px; }
}

/* ---------------------------------------------------------------- standing still
   Before the script runs, without it, or for a reader who has asked for less motion: the same words in a column,
   beside the finished sheet. */
.tutor:not(.tu-live) { padding: clamp(90px, 14vh, 160px) clamp(20px, 6vw, 112px); }
.tutor:not(.tu-live) .tu-stick { position: static; height: auto; overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(32px, 6vw, 96px); align-items: start; }
.tutor:not(.tu-live) :is(.tu-wall, .tu-vig, .tu-scrim, .tu-shade, .tu-desk, .tu-who, .tu-track, .tu-pick) { display: none; }
.tutor:not(.tu-live) .tu-words { position: static; display: block; grid-column: 1 / -1; margin-bottom: clamp(48px, 8vh, 90px); }
.tutor:not(.tu-live) .tu-words > div { opacity: 1; }
.tutor:not(.tu-live) .tu-side { position: static; width: auto; opacity: 1; display: block; }
.tutor:not(.tu-live) .tu-caps { min-height: 0; }
.tutor:not(.tu-live) .tu-cap { position: static; opacity: 1; transform: none; margin: 0 0 clamp(36px, 6vh, 60px); }
.tutor:not(.tu-live) .tu-cap h3 { font-size: clamp(30px, 3.2vw, 48px); margin-bottom: 12px; }
.tutor:not(.tu-live) .tu-cap h3 br { display: none; }
.tutor:not(.tu-live) .tu-still { display: block; position: sticky; top: 80px; width: 100%; max-width: 560px; height: auto; justify-self: end; border-radius: 3px; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55); }
.tutor:not(.tu-live) .tu-end { position: static; grid-column: 1 / -1; width: auto; opacity: 1; pointer-events: auto; align-items: center; text-align: center; margin-top: clamp(60px, 10vh, 120px); padding: 0; }
.tutor:not(.tu-live) .tu-end::before { display: none; }
.tutor:not(.tu-live) .tu-end h2 br { display: none; }
.tutor:not(.tu-live) .tu-end p.sub { margin: 18px auto 28px; }
@media (max-width: 899px) {
  .tutor:not(.tu-live) .tu-stick { display: block; }
  .tutor:not(.tu-live) .tu-side { padding: 0; background: none; box-shadow: none; }
  .tutor:not(.tu-live) .tu-still { position: static; margin: 0 auto 48px; }
}
