/* The Overview's ending (Faiq, 3 Dec 2026): the redesign on a device. The words and the call to action at the top
   left, the second way on at the bottom left, the device on the right (under them on a phone). On a desktop the story
   plays it (review.js): the benchmark's screen shrinks into this screen, the splash loads, the redesign comes up. On
   its own (a tablet, a phone, reduced motion) it plays when it is reached (overview.js). */
.fin {
  position: relative;
  box-sizing: border-box;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  padding: clamp(28px, 6svh, 72px) var(--gutter);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
/* the headline in the top-left corner, as TMV's home hero (Faiq, 3 Dec 2026: "the ending i am copying a bit like tmv
   home hero section"): its size and place, its lines rising into view in turn from behind their own edge, then the
   serif word written in from left to right in Great Eastern's red, as a second beat */
.fin-copy {
  position: absolute;
  z-index: 2;
  left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  top: clamp(32px, 6vh, 76px);
  max-width: min(40vw, 620px);
}
.fin-h {
  margin: 0;
  font: 700 clamp(38px, 4.4vw, 72px) / 1.06 var(--sans);
  letter-spacing: -0.035em;
}
.fin-h .hl {
  display: block;
  clip-path: inset(0 -1em -0.25em -1em);
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.fin-h .hl-in { display: block; white-space: nowrap; }
.fin-h em {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  color: #f0262d;
}
:root[data-theme='light'] .fin-h em { color: #d4111b; }
/* (on its own: the entrance plays once it is reached, overview.js adds .is-in, then .is-written) */
.fin:not(.is-in) .fin-h .hl-in { transform: translateY(105%); }
.fin .fin-h .hl-in { transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 0.12s); }
.fin .fin-h em { clip-path: inset(-0.3em 100% -0.3em -0.1em); transition: clip-path 1.1s cubic-bezier(0.65, 0, 0.35, 1); }
.fin.is-written .fin-h em { clip-path: inset(-0.3em -0.2em -0.3em -0.1em); }
.fin-go { margin-top: clamp(20px, 3.4vh, 36px); }
/* the iPad in the middle of the screen, the second way on under it: a line with its link underlined */
/* the device centred across the screen, as TMV's knight, and centred in the height left under the headline and its
   button, sized to it, so the two never meet (an iPad is wider than a knight) */
.fin {
  --fin-top: calc(clamp(32px, 6vh, 76px) + 2.12 * clamp(38px, 4.4vw, 72px) + clamp(20px, 3.4vh, 36px) + 88px);
}
@media (min-width: 700px) {
  .fin { padding-top: var(--fin-top); }
}
.fin-dev {
  width: min(56vw, calc((100svh - var(--nav-h) - var(--fin-top) - 96px) * 1.33));
}
.fin-why {
  margin: clamp(16px, 2.6vh, 28px) 0 0;
  font: 500 clamp(16px, 1.3vw, 19px) / 1.4 var(--sans);
  color: var(--fg-2);
  text-align: center;
}
.fin-why a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}
.fin-why a:hover { text-decoration-color: var(--red); }
/* the iPad: a dark screen inside an aluminium band, as the hero's */
.fin-frame {
  padding: 2.2%;
  border: 0.5% solid transparent;
  border-radius: 4.6% / 6%;
  background:
    linear-gradient(#050506, #050506) padding-box,
    linear-gradient(178deg, #9a9aa1 0%, #3b3b40 6%, #232327 40%, #2c2c31 85%, #55555c 100%) border-box;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 50px 90px -20px rgb(0 0 0 / 0.65);
}
.fin-screen {
  position: relative;
  aspect-ratio: 1376 / 1032;
  overflow: hidden;
  border-radius: 2.4% / 3.2%;
  /* (the benchmark's surface, which shrinks into this screen, so the two are one until the splash loads) */
  background: var(--raise);
}
.fin-splash,
.fin-shot { position: absolute; inset: 0; }
.fin-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
/* (on its own: the redesign comes up over the splash once it has loaded) */
.fin .fin-shot { clip-path: inset(100% 0% 0% 0%); transition: clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1); }
.fin.is-shown .fin-shot { clip-path: inset(0% 0% 0% 0%); }
/* a phone: the words, the iPhone, the second way on, one under the other */
@media (max-width: 699px) {
  .fin { grid-template-rows: auto 1fr auto; gap: 16px; }
  .fin-copy { position: static; max-width: none; grid-row: 1; justify-self: start; }
  .fin-h { font-size: clamp(32px, 9vw, 46px); }
  .fin-why { grid-row: 3; margin: 0; }
  .fin-dev { grid-row: 2; grid-column: 1; align-self: center; justify-self: center; width: min(66vw, calc((100svh - var(--nav-h) - 340px) * 0.46)); min-width: 150px; }
  .fin-frame { padding: 3.4%; border-radius: 14% / 6.6%; }
  .fin-screen { aspect-ratio: 1206 / 2622; border-radius: 11% / 5%; }
}
@media (prefers-reduced-motion: reduce) {
  .fin .fin-shot, .fin .fin-h .hl-in, .fin .fin-h em { transition: none; }
  .fin:not(.is-in) .fin-h .hl-in { transform: none; }
  .fin .fin-h em { clip-path: none; }
}
/* (in the story the timeline plays the headline, so its transitions are off) */
.ahero > .fin .fin-h .hl-in,
.ahero > .fin .fin-h em { transition: none; }
@media (max-width: 699px) and (max-height: 700px) {
  .fin { gap: 12px; padding-block: 20px; }
  .fin-h { font-size: 34px; }
  .fin-go { margin-top: 14px; }
}
