/* Geometry from the desktop and tablet frames. Each interval interpolates
   the same end values, so artwork and text stay in place during resize. */
@media (width >= 700px) {
  .hero {
    --growth: clamp(0px, 100cqw - 768px, 192px);
    --title-x: calc(42.7px + var(--growth) * 0.003646);
    --title-y: calc(137.3px + var(--growth) * 0.004687);
    --title-width: calc(684px + var(--growth) * 0.979688);
    --title-height: calc(139px + var(--growth) * 0.197917);
    --portrait-x: calc(271px + var(--growth) * 0.229167);
    --portrait-y: calc(94px + var(--growth) * 0.010417);
    --portrait-width: calc(242px + var(--growth) * 0.46875);
    --portrait-height: calc(511px + var(--growth) * 0.989583);
    --paper-y: calc(508px + var(--growth) * 0.755208);
    --paper-height: calc(358px + var(--growth) * 0.119792);
    --texture-height: calc(737px + var(--growth) * 1.223958);
    --benefits-y: calc(588px + var(--growth) * 0.911458);
    --benefits-bottom: calc(48px + var(--growth) * 0.166667);
    --content-gutter: 40px;
    --header-gutter: 40px;
    --intro-y: calc(341px + var(--growth) * 0.171875);
    --intro-width: 225px;
    --intro-size: 18px;
    --tagline-y: calc(385px + var(--growth) * 0.182292);
    --tagline-right: calc(40px + var(--growth) * 0.104167);
    --tagline-width: 209px;
    --cta-y: calc(468px + var(--growth) * 0.161458);
    --cta-width: calc(213px + var(--growth) * 0.348958);
    --cta-height: calc(57px + var(--growth) * 0.114583);
    --cta-size: calc(18px + var(--growth) * 0.03125);
    --benefit-title-size: calc(24px + var(--growth) * 0.052083);
    --benefits-gap: calc(20px - var(--growth) * 0.041667);
    --benefits-gutter: 80px;
  }
}

@media (width >= 1440px) {
  .hero:lang(uk) .hero__intro {
    top: calc(var(--intro-y) + var(--growth) * .0625);
    line-height: 34px;
  }
  .hero:lang(uk) .hero__cta { top: calc(var(--cta-y) + var(--growth) * .0479167); }
  .hero:lang(uk) .benefits { padding-block-end: calc(var(--benefits-bottom) + var(--growth) * .0520833); }
}

@media (width >= 1920px) {
  .hero:lang(uk) { --intro-y: 580px; --cta-y: 712px; }
  .hero:lang(uk) .hero__intro { top: var(--intro-y); }
  .hero:lang(uk) .hero__cta { top: var(--cta-y); }
}

@media (width >= 960px) {
  .hero {
    --growth: clamp(0px, 100cqw - 960px, 320px);
    --title-x: calc(43.4px + var(--growth) * 0.003438);
    --title-y: calc(138.2px + var(--growth) * 0.09625);
    --title-width: calc(872.1px + var(--growth) * 0.881563);
    --title-height: calc(177px + var(--growth) * 0.178125);
    --portrait-x: calc(315px + var(--growth) * 0.303125);
    --portrait-y: calc(96px + var(--growth) * 0.003125);
    --portrait-width: calc(332px + var(--growth) * 0.265625);
    --portrait-height: calc(701px + var(--growth) * 0.54375);
    --paper-y: calc(653px + var(--growth) * 0.096875);
    --paper-height: calc(381px - var(--growth) * 0.0375);
    --texture-height: 972px;
    --benefits-y: calc(763px + var(--growth) * 0.20625);
    --benefits-bottom: calc(80px + var(--growth) * 0.0625);
    --content-gutter: 40px;
    --header-gutter: 40px;
    --intro-y: calc(374px + var(--growth) * 0.2375);
    --intro-width: calc(225px + var(--growth) * 0.471875);
    --intro-size: calc(18px + var(--growth) * 0.01875);
    --tagline-y: calc(420px + var(--growth) * 0.24375);
    --tagline-right: calc(60px + var(--growth) * 0.071875);
    --tagline-width: calc(209px + var(--growth) * 0.421875);
    --cta-y: calc(499px + var(--growth) * 0.28125);
    --cta-width: calc(280px + var(--growth) * 0.334375);
    --cta-height: calc(79px + var(--growth) * 0.03125);
    --cta-size: 24px;
    --benefit-title-size: calc(34px + var(--growth) * 0.00625);
    --benefits-gap: calc(12px + var(--growth) * 0.0875);
    --benefits-gutter: 80px;
  }
}

@media (width >= 1280px) {
  .hero {
    --growth: clamp(0px, 100cqw - 1280px, 160px);
    --title-x: calc(44.5px + var(--growth) * 0.004687);
    --title-y: calc(169px + var(--growth) * 0.00625);
    --title-width: calc(1154.2px + var(--growth) * 1.2025);
    --title-height: calc(234px + var(--growth) * 0.24375);
    --portrait-x: calc(412px + var(--growth) * 0.63125);
    --portrait-y: calc(97px + var(--growth) * 0.01875);
    --portrait-width: 417px;
    --portrait-height: calc(875px - var(--growth) * 0.01875);
    --paper-y: calc(684px + var(--growth) * 0.29375);
    --paper-height: calc(369px - var(--growth) * 0.025);
    --texture-height: 972px;
    --benefits-y: calc(829px + var(--growth) * 0.26875);
    --benefits-bottom: 100px;
    --content-gutter: 40px;
    --header-gutter: 40px;
    --intro-y: calc(450px + var(--growth) * 0.25);
    --intro-width: calc(376px + var(--growth) * 0.43125);
    --intro-size: 24px;
    --tagline-y: calc(498px + var(--growth) * 0.56875);
    --tagline-right: calc(83px + var(--growth) * 0.33125);
    --tagline-width: 344px;
    --cta-y: calc(589px + var(--growth) * 0.25);
    --cta-width: calc(387px + var(--growth) * 0.13125);
    --cta-height: 89px;
    --cta-size: 24px;
    --benefit-title-size: 36px;
    --benefits-gap: calc(40px + var(--growth) * 0.0625);
    --benefits-gutter: 80px;
  }
}

@media (width >= 1440px) {
  .hero {
    --growth: clamp(0px, 100cqw - 1440px, 480px);
    --title-x: calc(45.25px + var(--growth) * 0.219271);
    --title-y: calc(170px - var(--growth) * 0.035417);
    --title-width: calc(1346.6px + var(--growth) * 0.559375);
    --title-height: calc(273px + var(--growth) * 0.135417);
    --portrait-x: calc(513px + var(--growth) * 0.472917);
    --portrait-y: calc(100px - var(--growth) * 0.008333);
    --portrait-width: 417px;
    --portrait-height: calc(872px + var(--growth) * 0.008333);
    --paper-y: calc(731px + var(--growth) * 0.1375);
    --paper-height: calc(365px + var(--growth) * 0.13125);
    --texture-height: 972px;
    --benefits-y: calc(872px + var(--growth) * 0.26875);
    --benefits-bottom: 100px;
    --content-gutter: calc(40px + var(--growth) * 0.229167);
    --header-gutter: calc(40px + var(--growth) * 0.083333);
    --intro-y: calc(490px + var(--growth) * 0.125);
    --intro-width: 445px;
    --intro-size: 24px;
    --tagline-y: 589px;
    --tagline-right: calc(136px + var(--growth) * 0.360417);
    --tagline-width: 344px;
    --cta-y: calc(629px + var(--growth) * 0.125);
    --cta-width: 408px;
    --cta-height: 89px;
    --cta-size: 24px;
    --benefit-title-size: 36px;
    --benefits-gap: 50px;
    --benefits-gutter: 80px;
  }
}

@media (width >= 1920px) {
  .hero {
    --title-x: 150.5px;
    --title-y: 153px;
    --title-width: 1615.1px;
    --title-height: 338px;
    --portrait-x: 740px;
    --portrait-y: 96px;
    --portrait-width: 417px;
    --portrait-height: 876px;
    --paper-y: 797px;
    --paper-height: 428px;
    --texture-height: 972px;
    --benefits-y: 1001px;
    --benefits-bottom: 100px;
    --content-gutter: 150px;
    --header-gutter: 80px;
    --intro-y: 550px;
    --intro-width: 445px;
    --intro-size: 24px;
    --tagline-y: 589px;
    --tagline-right: 309px;
    --tagline-width: 344px;
    --cta-y: 689px;
    --cta-width: 408px;
    --cta-height: 89px;
    --cta-size: 24px;
    --benefit-title-size: 36px;
    --benefits-gap: 50px;
    --benefits-gutter: 80px;
  }
}

.hero {
  --texture: url("../images/hero/360/texture.webp");
  --portrait: url("../images/hero/360/portrait.webp");
  --paper: url("../images/hero/360/paper.webp");
  --wordmark: url("../images/hero/360/wordmark.webp");
}

@media (width >= 420px) {
  .hero {
    --texture: url("../images/hero/480/texture.webp");
    --portrait: url("../images/hero/480/portrait.webp");
    --paper: url("../images/hero/480/paper.webp");
    --wordmark: url("../images/hero/480/wordmark.webp");
  }
}

@media (width >= 700px) {
  .hero {
    --texture: url("../images/hero/768/texture.webp");
    --portrait: url("../images/hero/768/portrait.webp");
    --paper: url("../images/hero/768/paper.webp");
    --wordmark: url("../images/hero/768/wordmark.webp");
  }
}

@media (width >= 864px) {
  .hero {
    --texture: url("../images/hero/960/texture.webp");
    --portrait: url("../images/hero/960/portrait.webp");
    --paper: url("../images/hero/960/paper.webp");
    --wordmark: url("../images/hero/960/wordmark.webp");
  }
}

@media (width >= 1120px) {
  .hero {
    --texture: url("../images/hero/1280/texture.webp");
    --portrait: url("../images/hero/1280/portrait.webp");
    --paper: url("../images/hero/1280/paper.webp");
    --wordmark: url("../images/hero/1280/wordmark.webp");
  }
}

@media (width >= 1360px) {
  .hero {
    --texture: url("../images/hero/1440/texture.webp");
    --portrait: url("../images/hero/1440/portrait.webp");
    --paper: url("../images/hero/1440/paper.webp");
    --wordmark: url("../images/hero/1440/wordmark.webp");
  }
}

@media (width >= 1680px) {
  .hero {
    --texture: url("../images/hero/1920/texture.webp");
    --portrait: url("../images/hero/1920/portrait.webp");
    --paper: url("../images/hero/1920/paper.webp");
    --wordmark: url("../images/hero/1920/wordmark.webp");
  }
}

@media (width < 700px) {
  .hero {
    --paper-overlap: clamp(53px, calc(41px + 3.333cqw), 57px);
    --paper-height: clamp(175px, calc(207px - 6.667cqw), 183px);
    --benefit-title-size: clamp(20px, calc(8px + 3.333cqw), 24px);
    --mobile-action-gap: clamp(10px, calc(46px - 7.5cqw), 19px);
  }

  /* With the portrait below the title, close up the space between the color groups. */
  .hero__title--uk {
    --wordmark-view-width: 1582;
    --wordmark-trim: 125;
  }
  .hero__title--en {
    --wordmark-view-width: 1532;
    --wordmark-trim: 70;
  }
  :is(.hero__title--uk, .hero__title--en) .hero__wordmark {
    width: calc(100% * var(--wordmark-view-width) / (var(--wordmark-view-width) - var(--wordmark-trim)));
  }
  :is(.hero__title--uk, .hero__title--en) .hero__wordmark-accent {
    transform: translateX(calc(-1px * var(--wordmark-trim)));
  }
}

@media (700px <= width < 768px) {
  .hero {
    --title-width: calc(100cqw - 84px);
    --title-height: calc(var(--title-width) * 0.2032);
    --portrait-x: calc(47.06cqw - 90.42px);
    --portrait-width: calc(56cqw - 188px);
    --portrait-height: calc(67.65cqw - 8.55px);
  }
}

@media (width >= 700px) {
  .hero__title--uk {
    top: calc(var(--title-y) - var(--title-height) * .07673);
    left: calc(var(--title-x) - var(--title-width) * .00038);
    width: calc(var(--title-width) * .9791);
    height: calc(var(--title-height) * 1.213);
  }
  .hero__title--en {
    top: calc(var(--title-y) + var(--title-height) * .12269);
    left: calc(var(--title-x) - var(--title-width) * .000382);
    width: calc(var(--title-width) * .94823);
    height: calc(var(--title-height) * 1.01924);
  }
  .hero:lang(en) {
    --en-portrait-shift: calc(var(--title-width) * .071203);
    --en-portrait-widen: calc(var(--title-width) * .017956);
    --en-tagline-gap: 12px;
  }
  .hero:lang(en) .hero__portrait {
    left: calc(var(--portrait-x) + var(--en-portrait-shift));
    top: calc(var(--portrait-y) - 1px);
    width: calc(var(--portrait-width) + var(--en-portrait-widen));
    height: calc(var(--portrait-height) + 1px);
    background-image: url("../images/hero/en-portrait.webp");
  }
  .hero:lang(en) .hero__tagline {
    left: max(
      calc(100% - var(--tagline-right) - var(--tagline-width)),
      calc(var(--portrait-x) + var(--en-portrait-shift) + var(--portrait-width) + var(--en-portrait-widen) + var(--en-tagline-gap))
    );
    right: var(--content-gutter);
    width: auto;
    max-width: var(--tagline-width);
  }
}

@media (700px <= width < 960px) {
  .hero:lang(en) .hero__tagline { font-size: 16px; }
}

@media (width >= 1440px) {
  .hero:lang(en) {
    --intro-width: calc(445px + var(--growth) * .170833);
    --cta-y: calc(629px + var(--growth) * .139583);
    --tagline-y: calc(589px + var(--growth) * .23125);
    --en-tagline-gap: calc(12px - var(--growth) * .11);
  }
  .hero:lang(en) .hero__intro { top: calc(var(--intro-y) + 25px + var(--growth) * .03125); }
}
