/* THE ENDING (v15): rules for the dive into the ocean. Loaded after scenes.css, so it may override the #end rules there. */

/* one screen for the stage to arrive, a short pinned stretch where the dot falls, then room for the footage to play */
#end { height: 250vh; }

/* The bridge: a canvas over the whole stage. Shut, it is the page's black with the surface line drawn on it.
   From the moment of impact end.js paints the black itself, with the opening cut out of it. Clear, it is gone. */
#end .end-bridge { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
#end.end-shut .end-bridge { background: #01030a; }
#end.end-clear .end-bridge { visibility: hidden; }

/* The dot: fixed to the screen, so it falls through the black whether or not the stage has reached the top yet.
   end.js moves it (transform and opacity only). The line above it is its trail while it falls. */
#end .end-dot { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 5; pointer-events: none; opacity: 0; will-change: transform, opacity; }
#end .end-dot b { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ink); }
#end .end-dot i {
  position: absolute; left: -1px; bottom: 0; width: 2px; height: 160px; opacity: 0;
  background: linear-gradient(0deg, rgba(243, 245, 248, .85), rgba(243, 245, 248, 0));
  transform-origin: 50% 100%; transform: scaleY(0); will-change: transform, opacity;
}

/* reduced motion: the finished state, no bridge */
.is-reduced #end .end-bridge, .is-reduced #end .end-dot { display: none; }

/* THE ASK (v15): one thing to press. The lead line, then Book a meeting as the display link with a rule drawn under
   it when it lands, then every other way to reach him as one quiet row. (Overrides the #end .end-cta rules in scenes.css.) */
#end .end-cta .lead { max-width: 60ch; margin: 0 auto; }
#end .end-cta .lead span { display: block; text-wrap: balance; }
#end .end-cta a.display { margin-top: clamp(16px, 2.6vh, 28px); padding-bottom: .2em; background-size: 0 3px; }
#end.end-asked .end-cta a.display { background-size: 100% 3px; }
#end .end-cta .end-links { margin-top: clamp(26px, 4.6vh, 48px); column-gap: clamp(22px, 2.6vw, 40px); row-gap: 0; }
#end .end-cta .end-links a {
  padding: 11px 0; font-size: clamp(16px, 1.2vw, 18px); font-weight: 500; color: var(--soft);
  background-position: 0 calc(100% - 8px); transition: color .3s ease, background-size .8s cubic-bezier(.7,0,.2,1);
}
#end .end-cta .end-links a:hover { color: var(--ink); }
#end .end-cta .end-links em { color: rgba(243, 245, 248, .6); }
.is-mobile #end .end-cta .lead { font-size: 17.5px; line-height: 1.32; }
.is-mobile #end .end-cta a.display { font-size: clamp(38px, 11.4vw, 52px); margin-top: 14px; }
.is-mobile #end .end-cta .end-links { flex-direction: row; margin-top: 20px; column-gap: 24px; row-gap: 0; }
.is-mobile #end .end-cta .end-links a { font-size: 16px; }
/* a short phone (the toolbar out on a small one): the same ask, set a little tighter so the last link clears the footer */
@media (min-height: 481px) and (max-height: 600px) {
  .is-mobile #end .end-cta { top: 38%; }
  .is-mobile #end .end-cta a.display { margin-top: 10px; }
  .is-mobile #end .end-cta .end-links { margin-top: 8px; }
}
/* a phone on its side: the name, then the ask in the room under it */
@media (max-height: 480px) {
  #end .end-cta, .is-mobile #end .end-cta { top: 44%; }
  #end .end-cta .lead, .is-mobile #end .end-cta .lead { font-size: 17px; line-height: 1.3; }
  #end .end-cta a.display, .is-mobile #end .end-cta a.display { font-size: clamp(30px, 9.6vh, 40px); margin-top: 6px; }
  #end .end-cta .end-links, .is-mobile #end .end-cta .end-links { margin-top: 2px; }
  #end .end-cta .end-links a, .is-mobile #end .end-cta .end-links a { font-size: 15px; padding: 10px 0; background-position: 0 calc(100% - 7px); }
}
