/* Inter Variable, subset to Latin-1 plus the punctuation this page can use:
   344KB of the full 2937-glyph face down to 53KB, both axes intact. The
   public full face stays as the fallback if the local file ever 404s. */
@font-face {
  font-family: 'InterV';
  src: url(assets/inter-latin.woff2) format('woff2'),
       url('https://rsms.me/inter/font-files/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A,
                 U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A,
                 U+2044, U+20AC, U+2122, U+2212;
}

@property --u { syntax: "<length>"; inherits: true; initial-value: 1px; }

:root {
  /* The background is footage and the footage is greyscale, so the page is
     monochrome: near-white type on near-black, and no accent hue at all. */
  --ground: #07080a;
  --ink: #f2f1ec;
  --on-light: #12130f;

  --w-brand: 535;
  --w-display: 400;
  --w-body: 400;
  --w-action: 620;

  --e-reveal: cubic-bezier(.16, 1, .3, 1);
  --e-settle: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
h1, h2, p { margin: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: 'InterV', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: none;
  font-variation-settings: "opsz" 32;
  font-synthesis: none;
  overflow-x: hidden;
}

html { scroll-behavior: smooth; }

a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .action::before { display: none; }
}

/* ---------------------------------------------------------------- *
 * One relative unit drives every measurement. The section's font
 * size is derived from the viewport, --u is a hundredth of it, and
 * `calc(N * var(--u))` scales the whole layout together. That is why
 * there are no width breakpoints: only the portrait aspect query.
 * ---------------------------------------------------------------- */

.hero-section {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  font-size: min(max(calc(100vw / 14.4), calc(100svh / 8.62)), calc(100svh / 6.8), 175px);
  --u: .01em;
}

@media (max-aspect-ratio: 1/1) {
  .hero-section {
    font-size: min(calc(100vw / 3.9), calc((100vw + 780px) / 11.7), calc(100svh / 4.70));
    --u: .01em;
  }
}

.hero-section [hidden] { display: none !important; }

.hero-section a:focus-visible,
.hero-section button:focus-visible {
  outline: calc(2 * var(--u)) solid #fff;
  outline-offset: calc(5 * var(--u));
  border-radius: calc(4 * var(--u));
}

/* ---------- background ---------- */

/* The poster sits on the element itself, not only on the <video>, so it is
   what shows before the first frame decodes and what remains if the file
   fails outright. */
.hero-section__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--ground) url(assets/background-poster.jpg) 62% 50% / cover no-repeat;
}

@media (max-aspect-ratio: 1/1) {
  .hero-section__bg { background-position: 58% 50%; }
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* The footage is 16:9; on a tall phone the crop would otherwise centre on
     empty black, so it is pulled toward the lit half of the frame. */
  object-position: 62% 50%;
  pointer-events: none;
  /* Desaturated in the encode, not here; this is only the contrast that
     greyscaling flattens out of it. */
  filter: contrast(1.12) brightness(.94);
}

/* Two scrims. The flat one keeps the brightest caustics off the type
   wherever they drift; the lower-left one sits under the copy, which is the
   only place the page actually has to be readable. */
.scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(118% 92% at 8% 88%, rgba(4, 5, 7, .88) 0%, rgba(4, 5, 7, .62) 34%, rgba(4, 5, 7, 0) 72%),
    linear-gradient(to bottom, rgba(4, 5, 7, .58) 0%, rgba(4, 5, 7, .18) 32%, rgba(4, 5, 7, .22) 70%, rgba(4, 5, 7, .55) 100%);
}

@media (max-aspect-ratio: 1/1) {
  .bg-video { object-position: 58% 50%; }
  .scrim {
    background:
      radial-gradient(130% 70% at 20% 86%, rgba(4, 5, 7, .90) 0%, rgba(4, 5, 7, .66) 40%, rgba(4, 5, 7, .10) 78%),
      linear-gradient(to bottom, rgba(4, 5, 7, .52) 0%, rgba(4, 5, 7, .22) 30%, rgba(4, 5, 7, .62) 100%);
  }
}

/* ---------- stage ---------- */

.stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: calc(30.96 * var(--u)) calc(32 * var(--u)) calc(60 * var(--u));
}

.vsp {
  display: block;
  flex-basis: 0;
  min-width: 0;
  min-height: calc(16 * var(--u));
}

.vsp-a { flex-grow: 2.0; }
.vsp-b { flex-grow: 1; }

.head, .hero { flex-shrink: 0; }

@media (max-aspect-ratio: 1/1) {
  .stage { padding: calc(22 * var(--u)) calc(20 * var(--u)) calc(26 * var(--u)); }
  .vsp { min-height: calc(10 * var(--u)); }
  .vsp-a { flex-grow: 3; }
}

/* ---------- header ---------- */

.head {
  display: flex;
  align-items: center;
  height: calc(41.76 * var(--u));
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: calc(12 * var(--u));
  position: relative;
  top: calc(.28 * var(--u));
  white-space: nowrap;
  font-size: calc(21.2 * var(--u));
  font-weight: var(--w-brand);
  line-height: 1;
  letter-spacing: -.004em;
  text-shadow: 0 1px 16px rgba(0, 0, 0, .66);
}

/* The artwork is 122x160, so it is sized by height and the width follows. */
.logo-mark {
  width: auto;
  height: calc(33 * var(--u));
  flex: none;
  display: block;
}


@media (max-aspect-ratio: 1/1) {
  .head { height: calc(40 * var(--u)); }
  .logo { top: 0; gap: calc(11 * var(--u)); font-size: calc(17 * var(--u)); }
  .logo-mark { height: calc(29 * var(--u)); }
}

/* ---------- hero copy ---------- */

/* Regular weight at display size. The blueprint is right that a large
   heavy face reads as shouting; 400 at this scale reads as confidence. */
.hero h1 {
  width: min(calc(800 * var(--u)), 100%);
  font-size: calc(64 * var(--u));
  line-height: calc(70 * var(--u));
  font-weight: var(--w-display);
  letter-spacing: -.02em;
  /* Light type over moving footage needs its own floor; the shadow is a
     blur, not an outline, so it never reads as a stroke. */
  text-shadow: 0 2px 30px rgba(0, 0, 0, .62);
}

.ln {
  display: block;
  overflow: clip;
  overflow-clip-margin: calc(10 * var(--u));
  white-space: nowrap;
}

.w { display: inline-block; }

/* The sheen is the headline's own fill, so it needs no duplicate text and
   cannot light the footage behind it. It only runs once the entrance is
   over: background-clip on the h1 cannot follow transformed word spans. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  @media (prefers-reduced-motion: no-preference) {
    html:not(.js-entrance) .hero h1 {
      background-image: linear-gradient(100deg,
        var(--ink) 42%, #fff 50%, var(--ink) 58%);
      background-size: 320% 100%;
      background-position: 0 0;
      background-repeat: no-repeat;
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      /* The fill is a filter, not a text-shadow: text-shadow is painted from
         the glyph and survives a transparent fill, but drop-shadow applies to
         the gradient-filled result, so the two can never disagree. */
      text-shadow: none;
      filter: drop-shadow(0 calc(2 * var(--u)) calc(26 * var(--u)) rgba(0, 0, 0, .72));
      animation: sheen 9s cubic-bezier(.45, 0, .3, 1) 1.4s infinite;
    }
  }
}

/* Both endpoints keep the 320%-wide gradient covering the text; outside this
   range the background leaves bare patches and transparent glyphs vanish. */
@keyframes sheen {
  0%        { background-position: 100% 0; }
  26%, 100% { background-position: 0 0; }
}


.actions {
  display: flex;
  align-items: center;
  margin-top: calc(36 * var(--u));
  gap: calc(14 * var(--u));
}

.action {
  --mx: 50%;
  --my: 50%;
  --sheen: 0;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(9 * var(--u));
  height: calc(41.76 * var(--u));
  padding: 0 calc(22 * var(--u));
  border-radius: calc(20.88 * var(--u));
  font-size: calc(16 * var(--u));
  font-weight: var(--w-action);
  letter-spacing: -.026em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform .34s var(--e-settle), box-shadow .34s var(--e-settle);
}

/* A highlight that sits where the pointer is. --mx/--my come from main.js;
   --sheen fades the whole thing in and out so it never pops. */
.action::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx) var(--my),
              var(--sheen-colour) 0%, transparent 62%);
  opacity: var(--sheen);
  transition: opacity .32s ease;
  pointer-events: none;
}

.action svg,
.action span {
  transition: transform .42s var(--e-settle);
}

.action svg { width: calc(17 * var(--u)); height: calc(17 * var(--u)); flex: none; overflow: visible; }

.action:hover svg,
.action:focus-visible svg { transform: translateX(calc(-2 * var(--u))); }

.action:hover span,
.action:focus-visible span { transform: translateX(calc(1.5 * var(--u))); }

/* The press has to beat the hover lift, hence the larger specificity. */
.action:active { transform: translateY(0) scale(.975); transition-duration: .09s; }

.action-light {
  /* On white, a white sheen is invisible, so this one is a soft shade. */
  --sheen-colour: rgba(18, 19, 15, .13);
  background: #fff;
  color: var(--on-light);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .40);
}

.action-light:hover,
.action-light:focus-visible {
  transform: translateY(calc(-2 * var(--u)));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .58);
}

/* The second action borrows the footage instead of covering it. */
.action-glass {
  --sheen-colour: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .34);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  transition: transform .34s var(--e-settle), background-color .34s ease,
              border-color .34s ease, box-shadow .34s var(--e-settle);
}

.action-glass:hover,
.action-glass:focus-visible {
  transform: translateY(calc(-2 * var(--u)));
  background: rgba(255, 255, 255, .17);
  border-color: rgba(255, 255, 255, .62);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}

/* The mark leans in rather than sliding, so the two icons do not move alike. */
.action-glass:hover svg,
.action-glass:focus-visible svg {
  transform: translateX(calc(-2 * var(--u))) scale(1.08);
}

/* The flap lifts as the pointer approaches, the one flourish on the page. */
.action-light .flap {
  transform-box: view-box;
  transform-origin: 12px 6.6px;
  transition: transform .42s var(--e-settle);
}

.action-light:hover .flap,
.action-light:focus-visible .flap { transform: scaleY(-.9); }

@media (max-aspect-ratio: 1/1) {
  .hero h1 {
    width: calc(344 * var(--u));
    font-size: calc(34 * var(--u));
    line-height: calc(36.7 * var(--u));
    letter-spacing: -.022em;
  }

  /* Inline, so the headline reflows instead of holding desktop line breaks. */
  .ln { display: inline; overflow: visible; white-space: normal; }


  .actions {
    flex-direction: column;
    align-items: flex-start;
    margin-top: calc(30 * var(--u));
    gap: calc(12 * var(--u));
  }

  .action {
    height: calc(46 * var(--u));
    padding: 0 calc(26 * var(--u));
    border-radius: calc(23 * var(--u));
    font-size: calc(15.5 * var(--u));
  }
}

/* ---------- entrance ---------- */

@keyframes ent-line {
  from { transform: translateY(105%); }
  to { transform: translateY(0); }
}

@keyframes ent-rise {
  from { opacity: 0; transform: translateY(var(--rise)); }
  to { opacity: 1; transform: none; }
}

@keyframes ent-settle {
  from { opacity: 0; transform: translateY(calc(10 * var(--u))) scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .js-entrance .logo {
    --rise: calc(10 * var(--u));
    animation: ent-rise .70s var(--e-reveal) 0s both;
  }

  .js-entrance .w { animation: ent-line 1.05s var(--e-reveal) both; }
  .js-entrance .ln:nth-child(1) .w:nth-child(1) { animation-delay: .30s; }
  .js-entrance .ln:nth-child(1) .w:nth-child(2) { animation-delay: .38s; }
  .js-entrance .ln:nth-child(2) .w:nth-child(1) { animation-delay: .46s; }
  .js-entrance .ln:nth-child(2) .w:nth-child(2) { animation-delay: .54s; }

  .js-entrance .action { animation: ent-settle .60s var(--e-settle) both; }
  .js-entrance .action-light { animation-delay: .70s; }
  .js-entrance .action-glass { animation-delay: .76s; }

  .js-entrance .logo,
  .js-entrance .w,
  .js-entrance .action { will-change: transform, opacity; }

  /* Portrait reflows the headline, so a per-line mask would clip mid-wrap. */
  @media (max-aspect-ratio: 1/1) {
    .js-entrance .w { animation: none; }
    .js-entrance .hero h1 {
      --rise: calc(14 * var(--u));
      animation: ent-rise .75s var(--e-reveal) .34s both;
    }
  }
}
