/* Home hero: the desk photo with our sites on the laptop, the proof row in its faded foot,
   and the lemon floating in the juice at the edge. */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero__in {
  padding-top: calc(var(--header-height) + var(--primitive-spacing-12));
}

.hero__text,
.proof {
  position: relative;
  z-index: 3;
}

.hero__text {
  max-width: var(--measure-hero);
}

.hero__title {
  display: grid;
  gap: var(--primitive-spacing-5);
}

.hero__line {
  font-size: var(--primitive-fontSize-hero);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero__line em {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--ink);
}

/* A lime stroke under "crafted" that draws in once, left to right (from the first concept) */
.hero__line em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0.02em;
  bottom: 0.02em;
  height: 0.07em;
  border-radius: var(--primitive-radius-full);
  background-color: var(--mark);
  transform-origin: left center;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__line em::after {
    animation: swoosh 1100ms 400ms var(--primitive-easing-out) both;
  }
}

@keyframes swoosh {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.hero__lede {
  max-width: var(--measure-text);
  margin-top: var(--primitive-spacing-6);
  font-size: var(--primitive-fontSize-lg);
  color: var(--muted);
}

.hero__actions {
  margin-top: var(--primitive-spacing-8);
}

/* ---------- The photo, and the flat stage scaled to sit on it ---------- */
.hero__media {
  position: relative;
  overflow: hidden;
}

.scene {
  position: relative;
}

.hero .scene {
  position: absolute;
}

.scene__photo img {
  width: 100%;
}

.scene__stage {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--laptop-photo-w);
  height: var(--laptop-photo-h);
  transform: scale(var(--k, 0));
  transform-origin: 0 0;
  visibility: hidden;
  pointer-events: none;
}

.scene.is-ready .scene__stage {
  visibility: visible;
}

.screen {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--laptop-screen-w);
  height: var(--laptop-screen-h);
  overflow: hidden;
  transform-origin: 0 0;
  background-color: var(--ground-light-surface);
}

/* Glass and room light on the screen, so a bright site sits in a dim photo */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgb(255 255 255 / 0.16) 0%, transparent 32%),
    linear-gradient(180deg, transparent 55%, rgb(8 9 11 / 0.16));
}

.screen__slides {
  position: absolute;
  inset: 0;
}

.screen__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.screen__slide:first-child {
  opacity: 1;
}

.screen__track,
.screen__track img {
  width: var(--laptop-screen-w);
  max-width: none;
}

/* The photo fades into the page wherever the words need the dark */
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 22%),
    linear-gradient(0deg, var(--bg) 0%, transparent 25%);
}

/* ---------- Proof row ---------- */
.proof__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--primitive-spacing-4);
  margin-bottom: var(--primitive-spacing-4);
}

.proof__list {
  display: grid;
  gap: var(--primitive-spacing-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.proof__item {
  position: relative;
  padding-top: var(--primitive-spacing-4);
  border-top: 2px solid var(--line-strong);
}

.proof__value {
  display: block;
  font-family: var(--font-montserrat), var(--primitive-font-display);
  font-size: var(--primitive-fontSize-lg);
  line-height: var(--primitive-lineHeight-snug);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.proof__label {
  display: block;
  margin-top: var(--primitive-spacing-1-5);
  font-size: var(--primitive-fontSize-small);
  line-height: 1.45;
  color: var(--muted);
}

.proof__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  font-family: var(--font-montserrat), var(--primitive-font-display);
  font-size: var(--primitive-fontSize-xs);
  font-weight: 600;
  color: var(--text);
}

.hero .edge {
  margin-top: var(--primitive-spacing-24);
}

/* ---------- The reel: three sites, fifteen seconds each, fading while each scrolls at a steady pace ---------- */
@media (prefers-reduced-motion: no-preference) {
  .screen__slide {
    animation: reel-slide 45s linear infinite;
  }

  .screen__track {
    animation: reel-scroll 45s linear infinite;
  }

  .screen__slide:nth-child(2),
  .screen__slide:nth-child(2) .screen__track,
  .proof__item:nth-child(2)::before {
    animation-delay: -30s;
  }

  .screen__slide:nth-child(3),
  .screen__slide:nth-child(3) .screen__track,
  .proof__item:nth-child(3)::before {
    animation-delay: -15s;
  }

  /* The line over each number lights while its site is on the laptop */
  .proof__item::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -2px;
    height: 2px;
    background-color: var(--mark);
    opacity: 0;
    animation: reel-slide 45s linear infinite;
  }

  :root:has(.proof__list:hover, .proof__list :focus-visible) :is(.screen__slide, .screen__track) {
    animation-play-state: paused;
  }

  :root:has(.proof__list:hover, .proof__list :focus-visible) .proof__item::before {
    animation-play-state: paused;
  }
}

@keyframes reel-slide {
  0%,
  31% {
    opacity: 1;
  }

  33.3%,
  97% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes reel-scroll {
  0%,
  3% {
    transform: translateY(0);
  }

  30%,
  34% {
    transform: translateY(calc(-100% + var(--laptop-screen-h)));
  }

  /* Back to the top once it has faded out (gone by 33.3%), so the next fade-in opens on the header */
  35%,
  100% {
    transform: translateY(0);
  }
}

/* ---------- Phones and tablets: the photo behind the words, as on the old site ----------
   One fixed size (the words take about the same height at every width), the laptop to the
   right of centre, dimmed enough that every line of text passes AA over the bright screen,
   and faded into the ground before the proof row. */
@media (max-width: 63.99rem) {
  .hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .hero .scene {
    left: calc(50vw - var(--laptop-phone-x));
    top: 0;
    width: var(--laptop-phone-w);
    mask-image: linear-gradient(180deg, #000 60%, transparent 92%);
  }

  .hero__media::after {
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 82%, transparent) 0%, color-mix(in srgb, var(--bg) 74%, transparent) 55%, var(--bg) 92%);
  }

  /* Muted grey dips under 4.5:1 where the bright screen shows through; full white doesn't */
  .hero__lede {
    color: var(--text);
  }

  .proof {
    margin-top: var(--primitive-spacing-12);
  }
}

/* ---------- Desktop: the photo fills the hero and the words sit in its dark half ---------- */
@media (min-width: 64rem) {
  .hero__in {
    padding-top: calc(var(--header-height) + var(--primitive-spacing-16));
  }

  .hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .hero .scene {
    right: 0;
    top: 44%;
    width: max(100%, var(--laptop-min-w));
    translate: 0 -50%;
    mask-image: linear-gradient(180deg, #000 72%, transparent 96%);
  }

  .hero__media::after {
    background:
      linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, transparent) 30%, color-mix(in srgb, var(--bg) 30%, transparent) 52%, transparent 64%),
      linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, transparent) 0%, transparent 18%),
      linear-gradient(0deg, var(--bg) 6%, transparent 34%);
  }

  .proof {
    max-width: var(--measure-wide);
    margin: var(--primitive-spacing-16) 0 0 auto;
  }

  .proof__list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--primitive-spacing-8);
  }

  .proof__list {
    row-gap: 0;
  }

  /* Values, lines and names each sit on one line across the three */
  .proof__item {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .proof__link {
    align-self: end;
    padding-top: var(--primitive-spacing-2);
  }

  .proof__value {
    font-size: var(--primitive-fontSize-xl);
  }

  .hero .edge {
    margin-top: var(--primitive-spacing-12);
  }
}
