/* Teaching: hero, 100x pass (2026-09-28). Owned by the Teaching hero section agent.

   One photograph is the whole background. Round 2 (2026-10-24): Kien's June 2026 portrait session in
   the surgical lab at the Seattle Science Foundation, me in scrubs tracing a spine model with a probe,
   the way I teach anatomy (source 098). Round 1, a frame of my lecture at the lectern, is in
   tools/photos-2026/snapshot/. It is built as two plates by tools/photos-2026/build_plates.py: the room
   with me removed (extended left into defocused wall) and me with an alpha matte, the model in my hands
   added to the matte by GrabCut. At rest the plates register exactly; under the pointer and on scroll
   they part a few pixels, so the room gets its depth back. The words sit on the left over a paper haze,
   not a dark overlay.

   Geometry. The plates are 2160 x 1067 source pixels, anchored right bottom. The frame is at most 1.62
   times as wide as it is tall, so the model in my hands sits at 48 percent of the width or further
   right, and the copy column ends at 36 percent. Below 1100px the photograph is a band on top that
   dissolves into the paper, and the words rise over its lower edge.

   Loaded after the page's inline <style>; new class names only, tokens from site.css :root. */

.thx {
  --travel: cubic-bezier(0.28, 0.11, 0.32, 1);
  --settle: cubic-bezier(0.32, 0.72, 0, 1);
  --wall: #F4F5F6;                       /* the plate's own white, while it decodes */
  position: relative; isolation: isolate; overflow: clip;
  height: clamp(560px, calc(100vw / 1.62), calc(100svh - 2.5rem));
  background: var(--wall);
}

/* ---------- the photograph ---------- */
.thx__stage { position: absolute; inset: 0; z-index: 0; }
/* each plate bleeds 3 percent past the frame, so the parallax never shows an edge */
.thx__layer { position: absolute; inset: -3%; display: block; will-change: transform; }
.thx__layer img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: right bottom;
}
.thx__fg { transform-origin: 78% 30%; }   /* my face: the scroll dolly closes on it */

/* the paper haze under the words: strongest at the left edge, gone before my hand. A second, faint
   band at the top keeps the nav on clean paper. */
.thx__veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 150px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.74) 26%, rgba(255, 255, 255, 0.34) 40%, rgba(255, 255, 255, 0) 52%);
}

/* ---------- the words ---------- */
.thx__copy {
  position: absolute; z-index: 2; left: var(--gutter); top: calc(50% + var(--nav-h) / 2); translate: 0 -50%;
  width: calc(36vw - var(--gutter));
}
.thx__title {
  font-family: var(--display); font-weight: 700; font-style: normal;
  /* "nearly every year" is about 7.9em in Vollkorn Bold; at 4.1vw the headline keeps to three lines in
     the 32 to 34vw column at every desktop width */
  font-size: clamp(2.5rem, 4.1vw, 5.2rem); line-height: 1.03; letter-spacing: -0.022em;
  color: var(--ink); max-width: 8.6em; text-wrap: balance;
}
.thx__lede {
  margin-top: 1.35rem; max-width: 40ch;
  font-size: clamp(1.02rem, 1.12vw, 1.22rem); line-height: 1.6; color: var(--ink-2);
}
/* "named below": the one link in the lede, an underline that draws toward the roster */
.thx__down {
  color: var(--accent); text-decoration: none; font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.45s var(--travel), color 0.3s var(--travel);
}
.thx__down:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--accent-deep); }
.thx__down:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* the lecture: a white plate, the one way in to the recording */
.thx__lecture {
  margin-top: clamp(1.8rem, 3.2vw, 2.8rem);
  display: inline-grid; grid-template-columns: 2.6rem minmax(0, auto); column-gap: 0.9rem; align-items: center;
  max-width: 100%; padding: 0.7rem 1.15rem 0.7rem 0.7rem;
  background: rgba(255, 255, 255, 0.9); border-radius: 18px; color: var(--ink); text-decoration: none;
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px -18px rgba(10, 13, 18, 0.35);
  transition: translate 0.45s var(--settle), box-shadow 0.45s var(--travel), background 0.3s var(--travel);
}
.thx__play {
  grid-row: 1 / span 2; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink);
  transition: scale 0.45s var(--settle), background 0.3s var(--travel);
}
.thx__play::before {
  content: ''; margin-left: 3px;
  border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.thx__lt { font-family: var(--display); font-weight: 600; font-size: 1.04rem; line-height: 1.25; }
.thx__lm { font-family: var(--label); font-weight: 500; font-size: 0.9rem; color: var(--muted); }
.thx__lecture:hover { translate: 0 -2px; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 20px 40px -20px rgba(10, 13, 18, 0.42); }
.thx__lecture:hover .thx__play { scale: 1.08; background: var(--accent); }
.thx__lecture:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* hovering or focusing the lecture brings me forward: the wall steps back a little */
.thx__fg img, .thx__bg img { transition: scale 0.7s var(--travel), filter 0.7s var(--travel); }
.thx.is-lecture .thx__fg img { scale: 1.018; transform-origin: 78% 30%; }
.thx.is-lecture .thx__bg img { scale: 0.992; filter: brightness(1.03) saturate(0.85); }

/* ---------- arrival: the wall settles, I come into focus, the words rise out of a short blur ---------- */
@media (prefers-reduced-motion: no-preference) {
  .thx__bg { animation: thx-settle 1.8s var(--travel) both; }
  .thx__fg { animation: thx-focus 1.5s var(--travel) 0.12s both; }
  .thx__veil { animation: thx-fade 1.1s var(--travel) 0.15s both; }
  .thx__copy > * { animation: thx-rise 1s var(--travel) both; animation-delay: calc(0.25s + var(--i, 0) * 0.1s); }
}
@keyframes thx-settle { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@keyframes thx-focus { from { opacity: 0; transform: scale(1.035); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes thx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes thx-rise { from { opacity: 0; translate: 0 18px; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }

/* ---------- tablets and phones: the photograph as a band on top that dissolves into the paper ---------- */
@media (max-width: 1099px) {
  .thx { height: auto; overflow: visible; background: var(--paper); padding-top: var(--nav-h); }
  .thx__stage { position: relative; inset: auto; aspect-ratio: 1220 / 1027; overflow: clip; background: var(--wall); }
  .thx__layer img { object-position: 50% 100%; }
  .thx__fg { transform-origin: 67% 30%; }
  .thx__veil {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.8) 74%, #fff 94%);
  }
  .thx__copy {
    position: relative; left: auto; top: auto; translate: none; width: auto;
    margin: -3.2rem var(--gutter) 0; padding-bottom: clamp(2.2rem, 6vw, 3.5rem);
  }
  .thx__title { font-size: clamp(2.2rem, 7.4vw, 3.6rem); max-width: 12em; }
  .thx__lede { font-size: 1.04rem; max-width: 46ch; }
}
@media (max-width: 560px) {
  .thx__stage { aspect-ratio: 10 / 11; }
  .thx__layer img { object-position: 92% 100%; }   /* keeps me and the model, losing the empty room */
  .thx__copy { margin-top: -4.2rem; }
  .thx__lecture { display: grid; width: 100%; }
}

/* Desktop: the photograph runs up under the nav, as on Home and About */
@media (min-width: 1100px) {
  .thx { padding-top: 0; }
}

/* page pass: the two places in the lede lead to their own column of fellows; quieter than
   "named below" (a dotted rule), the same hand-off underneath */
.thx__era {
  color: inherit; text-decoration: underline dotted; text-decoration-color: var(--line-2);
  text-underline-offset: 0.2em; transition: color 0.25s, text-decoration-color 0.25s;
}
.thx__era:hover { color: var(--accent-deep); text-decoration-color: currentColor; }
.thx__era:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
