/* Residency stipend (2026-10-26), a section of Your Benefits since 2026-10-30. Loaded on /your-benefits/ only.

   The two-year journey (owner: "improve this graphic substantially"). One continuous track from the start of the
   final residency year to a year after it: twelve stipend months in olive, the moment residency is complete, then
   twelve months of service in deep green. The money and the shifts sit over the stretch where they happen; the final
   months' 6 to 7 shifts are marked as small Sedona ticks. Laptops read it left to right; phones read it down a rail.
   Plays once in view (pages/residency-stipend.js); without JS or with reduced motion it rests complete. */
.rs-journey{margin:clamp(28px,3vw,40px) 0 0;padding:clamp(24px,3vw,36px) clamp(22px,3vw,36px) clamp(20px,2.4vw,28px);border-radius:20px;background:var(--th-cream)}
.rs-journey-title{margin:0 0 clamp(22px,2.6vw,30px);font-family:THLora,Lora,Georgia,serif;font-weight:500;font-size:clamp(21px,2vw,25px);line-height:1.2;color:var(--th-basalt)}
.rs-phases{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(5,auto)}
.rs-phase{position:relative;grid-row:1/-1;display:grid;grid-template-rows:subgrid;margin:0;min-width:0}
.rs-phase > :not(.rs-track){margin:0}
.rs-phase--stipend > :not(.rs-track):not(.rs-when){padding-right:clamp(18px,2.6vw,32px)}
/* where residency ends: a quiet rule down the second year's text, meeting the marker on the track */
.rs-phase--service > :not(.rs-track):not(.rs-when){padding-left:clamp(18px,2.6vw,32px);border-left:1px solid rgba(63,82,44,.32)}
.rs-phase-name{font-family:THPoppins,Poppins,Arial,sans-serif!important;font-size:15px!important;font-weight:600;line-height:1.35;letter-spacing:0;color:var(--th-basalt)}
.rs-phase-fig{display:flex;align-items:baseline;gap:4px 10px;padding-top:8px}
.rs-phase-fig b{font-family:THLora,Lora,Georgia,serif;font-weight:500;font-size:clamp(40px,4.4vw,52px);line-height:1;letter-spacing:-.02em;color:var(--th-juniper);font-variant-numeric:lining-nums}
.rs-phase-fig span{min-width:0;font-size:15px;line-height:1.3;color:var(--th-basalt)}
.rs-phase-note{padding-top:10px;font-size:15px;line-height:1.55;color:var(--th-basalt)}
/* the shifts in the sentence carry the same Sedona as their ticks on the track */
.rs-phase-note u{text-decoration:underline 3px var(--th-sedona);text-underline-offset:5px;text-decoration-skip-ink:none}

/* the track: the line, one dot per month, the markers */
.rs-track{position:relative;height:58px;--y:38px}
.rs-line{position:absolute;left:0;right:0;top:var(--y);height:3px;margin-top:-1.5px;border-radius:3px;background:var(--th-olive);transform-origin:left center}
.rs-phase--service .rs-line{background:var(--th-juniper)}
.rs-dots{position:absolute;left:12px;right:12px;top:var(--y);display:grid;grid-template-columns:repeat(12,minmax(0,1fr));transform:translateY(-50%)}
.rs-dots i{justify-self:center;width:9px;height:9px;border-radius:50%;background:var(--th-olive)}
.rs-phase--service .rs-dots i{background:var(--th-juniper)}
.rs-mark{position:absolute;top:var(--y);width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border-radius:50%;background:var(--th-cream);box-shadow:inset 0 0 0 3px var(--th-olive)}
.rs-mark--start{left:0}
.rs-mark--end{left:100%;box-shadow:inset 0 0 0 3px var(--th-juniper)}
.rs-mark--done{left:0;z-index:1;width:24px;height:24px;margin:-12px 0 0 -12px;background:var(--th-juniper);box-shadow:none}
.rs-mark--done::after{content:"";position:absolute;inset:7px;border-radius:50%;background:var(--th-lperidot)}
.rs-mark--done::before{content:"";position:absolute;left:50%;bottom:100%;width:1px;height:calc(var(--y) - 12px);margin-left:-.5px;background:rgba(63,82,44,.32)}
/* the final months' 6 to 7 shifts: seven small ticks over the last stretch, the seventh lighter */
.rs-shifts{position:absolute;right:calc(100% / 24);bottom:calc(100% - var(--y) + 10px);display:flex;gap:5px;align-items:flex-end}
.rs-shifts i{display:block;width:4px;height:16px;border-radius:2px;background:var(--th-sedona);transform-origin:bottom center}
.rs-shifts i:last-child{opacity:.45}
.rs-when{display:flex;justify-content:space-between;gap:12px;padding-top:2px;font-size:14px;line-height:1.35;color:var(--th-basalt)}
.rs-when-done{font-weight:600;transform:translateX(-50%)}
.rs-phase--service .rs-when{padding-left:0!important;border-left:0!important}

/* motion: armed just before it scrolls in, then drawn left to right once */
.rs-journey.is-armed:not(.is-in) .rs-line{transform:scaleX(0)}
.rs-journey.is-armed:not(.is-in) .rs-dots i,.rs-journey.is-armed:not(.is-in) .rs-mark{transform:scale(0)}
.rs-journey.is-armed:not(.is-in) .rs-shifts i{transform:scaleY(0)}
.rs-journey.is-in .rs-line{transform:none;transition:transform 1.25s cubic-bezier(.45,0,.25,1)}
.rs-journey.is-in .rs-phase--service .rs-line{transition-delay:1.3s}
.rs-journey.is-in .rs-dots i{transform:none;transition:transform .42s cubic-bezier(.3,1.5,.5,1) calc(.08s + var(--i) * 98ms)}
.rs-journey.is-in .rs-phase--service .rs-dots i{transition-delay:calc(1.38s + var(--i) * 98ms)}
.rs-journey.is-in .rs-mark{transform:none;transition:transform .5s cubic-bezier(.3,1.5,.5,1)}
.rs-journey.is-in .rs-mark--done{transition-delay:1.22s}
.rs-journey.is-in .rs-mark--end{transition-delay:2.55s}
.rs-journey.is-in .rs-shifts i{transform:none;transition:transform .35s cubic-bezier(.3,1.4,.5,1) calc(.95s + var(--i) * 55ms)}

/* phones: the same journey down a rail, each year beside its own stretch of months */
@media (max-width:600px){
  .rs-journey{padding:22px 18px 20px;border-radius:16px}
  /* both years get the same length of rail: twelve months are twelve months */
  .rs-phases{grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-auto-rows:1fr}
  .rs-phase{grid-row:auto;grid-template-rows:auto auto auto 1fr auto;grid-template-columns:34px minmax(0,1fr);column-gap:12px}
  .rs-phase > :not(.rs-track){grid-column:2;padding-left:0!important;padding-right:0!important;border-left:0!important}
  .rs-when{display:contents}
  .rs-when span{grid-column:2;font-size:14px}
  .rs-when-done{transform:none}
  .rs-phase--stipend .rs-when span{grid-row:1;padding-bottom:10px}
  .rs-phase--stipend .rs-phase-name{grid-row:2}.rs-phase--stipend .rs-phase-fig{grid-row:3}.rs-phase--stipend .rs-phase-note{grid-row:4;padding-bottom:34px}
  .rs-phase--service .rs-when-done{grid-row:1;padding-bottom:10px}
  .rs-phase--service .rs-phase-name{grid-row:2}.rs-phase--service .rs-phase-fig{grid-row:3}.rs-phase--service .rs-phase-note{grid-row:4}
  .rs-phase--service .rs-when span:last-child{grid-row:5;align-self:end;padding-top:22px}
  .rs-track{grid-column:1;grid-row:1/-1;height:auto;--y:0}
  .rs-phase--stipend .rs-track{grid-row:1/5}
  .rs-phase--service .rs-track{grid-row:1/6}
  .rs-line{left:50%;right:auto;top:9px;bottom:0;width:3px;height:auto;margin:0 0 0 -1.5px;transform-origin:center top}
  .rs-phase--service .rs-line{bottom:9px}
  .rs-dots{left:0;right:0;top:34px;bottom:14px;grid-template-columns:none;grid-template-rows:repeat(12,minmax(0,1fr));align-items:center;transform:none}
  .rs-phase--service .rs-dots{top:40px;bottom:28px}
  .rs-dots i{width:9px;height:9px}
  .rs-mark{left:50%!important;top:9px}
  .rs-mark--end{top:auto;bottom:9px;margin:0 0 -6.5px -6.5px}
  .rs-mark--done{top:13px}
  .rs-mark--done::before{display:none}
  .rs-shifts{right:auto;left:calc(50% + 9px);bottom:16px;flex-direction:column;gap:4px;align-items:flex-start}
  .rs-shifts i{width:12px;height:3px;transform-origin:left center}
  .rs-journey.is-armed:not(.is-in) .rs-line{transform:scaleY(0)}
  .rs-journey.is-armed:not(.is-in) .rs-shifts i{transform:scaleX(0)}
}
@media (prefers-reduced-motion:reduce){.rs-journey *{transition:none!important}}
