/* Component 02 · Hero
   A measured copy of palantir.com's hero (checked 25 Sept 2026):
   - a full-screen dark frame pinned behind the page, with the looping video in it under a dark layer
   - a two-line headline whose words slide up into view, line 1 then line 2
   - a "Scroll to Explore" cue that flickers on, with a gently bobbing arrow
   The sections after the hero slide up over the pinned frame like a curtain, so each one
   needs its own background and must sit above it (position: relative; z-index: 5). */

/* The pinned frame. #0d0e10 is Palantir's frame color, shown until the video loads. */
.hero-media {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-color: #0d0e10;
}
.hero-media video,
.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Dark layer over the video (Nathan chose "lighter edges", 3 Oct): 50% behind the headline, like Palantir's,
   so it stays readable over the brightest shots; only 25% at the top and bottom, so more of the colour shows there.
   (Palantir's own layer is 60% / 50% / 50% / 60%.) */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.25) 0, rgba(0, 0, 0, 0.5) 30%, rgba(0, 0, 0, 0.5) 70%, rgba(0, 0, 0, 0.25));
}

.hero {
  position: relative;
  z-index: 5;
  display: grid;
  min-height: 100vh;
  padding: 100px 40px;
  color: #efefef;
}
@media (min-width: 560px)  { .hero { padding: 40px; } }
@media (max-width: 1061px) { .hero { grid-template-rows: 1fr auto; } }

/* Phones: everything centred in a column. Wider screens: the headline's own padding centres it. */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  line-height: 70px;
  text-align: center;
}
@media (min-width: 760px) { .hero-content { display: block; } }

/* Headline: Palantir's 80px with tight tracking */
.hero h1 {
  position: relative;
  margin: 0;
  padding: 5vh 0 10vh;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
}
@media (min-width: 760px) {
  .hero h1 {
    padding: 35vh 0;
    font-size: 80px;
    line-height: 78px;
    letter-spacing: -3.4px;
  }
}

/* Phones: the headline sits in the exact middle of the screen, and the scroll cue at the bottom
   (Nathan, 4 Oct: they used to be centred as one group, which put the headline above the middle).
   Equal rows above and below the headline keep it centred; the cue sits at the foot of the lower one.
   100svh is the screen height with the browser's bars showing, so the middle is the visible middle. */
@media (max-width: 759px) {
  .hero { min-height: 100vh; min-height: 100svh; }
  .hero-content { display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center; }
  .hero-content > * { grid-column: 1; }   /* one column, so the arrow and label stack instead of sitting side by side */
  .hero h1 { grid-row: 2; padding: 0; }
  .hero-arrow,
  .hero-content > p { grid-row: 3; align-self: end; }
  .hero-content > p { line-height: 22px; }
  .hero-arrow { margin-bottom: 30px; }
}

/* Each word starts hidden just below its line and slides up into view */
.hero .word {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 0 3px;
  mix-blend-mode: difference;   /* like the wordmark: stays readable over light or dark video */
  clip-path: inset(0 0 100%);
  transform: translateY(100%);
  animation: hero-word-up 0.5s ease 0.2s forwards;
}
.hero .word.line-2 { animation-delay: 0.5s; }
@media (min-width: 760px) { .hero .word { padding: 0 10px; } }

/* Ends slightly larger than the word's box, so letters that dip below the line (g, y, p) aren't cut off */
@keyframes hero-word-up {
  to { clip-path: inset(-0.3em 0 -0.35em 0); transform: translateY(0); }
}

/* A white copy of the wordmark, lined up over the real one (made by js/hero-wordmark.js).
   Invisible most of the time; it fades in partly only when the video behind the wordmark turns
   mid-grey, so the wordmark keeps changing color with each shot but never fades into it. */
.nav-brand-ease {
  position: fixed;
  z-index: 600;
  top: 0;
  left: var(--contain);
  padding-top: var(--v-gutter);
  opacity: 0;
  pointer-events: none;
}

/* Scroll cue: arrow + label flicker on after 1s; the arrow keeps bobbing 2px */
.hero-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  opacity: 0;
  animation: hero-flicker 2s ease 1s forwards, hero-bounce 1s linear infinite;
}
@media (min-width: 760px) { .hero-arrow { display: flex; margin: 0 auto; } }

.hero-content > p {
  display: inline-block;
  padding: 0 10px;
  font-size: 16px;
  letter-spacing: normal;
  opacity: 0;
  animation: hero-flicker 2s ease 1s forwards;
}

@keyframes hero-flicker {
  0%, 2%   { opacity: 1; }
  3%, 5%   { opacity: 0.1; }
  6%, 8%   { opacity: 1; }
  9%, 11%  { opacity: 0.1; }
  12%      { opacity: 1; }
  15%      { opacity: 0.1; }
  16%      { opacity: 1; }
  17%      { opacity: 0.1; }
  18%, 100% { opacity: 1; }
}
@keyframes hero-bounce {
  0%, 50%, 100% { transform: translateY(0); }
  25%           { transform: translateY(2px); }
  75%           { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero .word { animation: none; clip-path: none; transform: none; }
  .hero-arrow,
  .hero-content > p { animation: none; opacity: 1; }
}
