/* ==========================================================================
   LOOK: SELF-PROMO
   Figma frame 6049:6244. Hepta Slab titles on a white page that greys towards
   the right, where Jared's head sits half off the edge of the screen and
   changes material as you scroll. The heads are drawn by heads.js.
   ========================================================================== */
html[data-look="self-promo"] {
  --font-display: "Hepta Slab", Georgia, serif;
  --text-display: min(72px, 7.5vw);            /* Figma: 72px */
  --color-page: #ffffff;

  /* The head's box: its height, and how far its centre sits in from the right edge.
     The box is 1.35 times the screen below the nav, so the top of the head and the neck
     always run past the top and bottom of the screen. Capped at 95% of the width for tall tablets. */
  --head-h: min(calc((100lvh - var(--nav-height)) * 1.35), 95vw);
  --head-x: 2vw;                               /* the head's centre, in from the right edge */
  --head-top: calc(var(--nav-height) + (100lvh - var(--nav-height) - var(--head-h)) / 2);

  background: linear-gradient(90deg, #ffffff 52%, #e2e2e2);
}

/* Titles are bold, everything else in Hepta Slab is semibold (Figma) */
html[data-look="self-promo"] :is(h1, h2, .display) { font-weight: 700; line-height: 1.15; }
html[data-look="self-promo"] .hero h1 { line-height: 1.2; }
html[data-look="self-promo"] :is(h3, .step-title span, .decide-sub, .decide-notes, .team-sport,
  .result-number, .dive-title, .song-label, .demo-label, .lead-arrow) { font-weight: 600; }
html[data-look="self-promo"] :is(.decide-sub, .decide-notes, .team-sport, .result-number) { line-height: 1.1; }

/* The name in the nav stays in Cal Sans (Figma) */
html[data-look="self-promo"] .brand-name { font-family: "Cal Sans", "Helvetica Neue", Arial, sans-serif; }

/* The head replaces the round photo in the hero */
html[data-look="self-promo"] .hero-photo { display: none; }
html[data-look="self-promo"] .hero h1 { max-width: 783px; }
html[data-look="self-promo"] .hero-tags { max-width: none; }

/* The text stops about where the head starts. Heads are about 0.27 of the box wide on each side
   of their centre, so the widest ones (the doll) tuck a few pixels under the ends of long lines. */
html[data-look="self-promo"] .content {
  padding-right: max(var(--space-page), calc(var(--head-h) * 0.25 + var(--head-x) + 16px));
}

/* Two-column sections use Figma's Self-Promo columns, in a 1054px wide text area */
html[data-look="self-promo"] .split { --col: 44.6%; --gap: 55px; }          /* 470px */
html[data-look="self-promo"] .split--wide-gap { --col: 43.6%; --gap: 60px; } /* 460px */
html[data-look="self-promo"] .clients { --col: 43.6%; --gap: 64px; }

/* The head. Fixed behind the page, and it never intercepts clicks.
   heads.js only draws the part of this box that's on screen. */
#heads {
  position: fixed;
  top: var(--head-top);
  right: calc(var(--head-x) - var(--head-h) * 0.4);
  width: calc(var(--head-h) * 0.8);
  height: var(--head-h);
  z-index: -1;
  pointer-events: none;
}
/* The soft shadow behind every head: one ready-blurred image of their average outline,
   a little down and to the left, stretched to the head's box. The image has a blank
   margin so the blur fades out completely, so it reaches a little past the box on every
   side. Change the opacity to make it lighter or darker. */
#heads::before {
  content: "";
  position: absolute;
  inset: -15% -18.75%;   /* the image's 60px margin, at 400 tall by 320 wide */
  background: url("shadow.png") center / 100% 100% no-repeat;
  opacity: 0.16;
}
#heads canvas { position: absolute; }   /* placed by heads.js */
#heads img {   /* only if the browser can't draw the effects */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(0.94);
}

/* Phones (Figma "self-promo - mobile"): a big head, about twice the screen width,
   in the bottom right corner. Its top sits just below the middle of the screen,
   and the text runs over it. Titles are 48px, the first one 60px. */
@media (max-width: 820px) {
  html[data-look="self-promo"] {
    --head-h: 213vw;                                     /* the head itself is 200vw tall */
    --head-x: 7vw;                                       /* Figma: centre at 367 of 393 */
    --head-top: calc(48svh - var(--head-h) * 0.03);      /* Figma: top of the head at 48% */
    --text-display: 48px;
  }
  html[data-look="self-promo"] .hero h1 { font-size: 60px; }
  html[data-look="self-promo"] .content { padding-right: var(--space-page); }
}
