/* Digital X — homepage cinematic layer.
   Loads after the compiled homepage styles and only adds what the scroll-scrub
   film needs: the scroll track, the per-chapter copy plates and the mobile
   letterbox. Everything else on the page keeps the production design system. */

:root {
  --nav-h: 4.5rem;
  /* 360 desktop frames over this track ≈ one frame per 2.9vh of scroll, so the
     scrub advances about 35 frames per viewport. Anything shorter starts to
     read as stepping rather than motion. */
  --film-scroll: 1150vh;
}

/* -------------------------------------------------------------- opening screen */

/* The first screen is the portal plate with the statement over it; the film
   starts one scroll later, so nothing competes with it. */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  background: var(--ink);
  overflow: hidden;
}

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

.hero__backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

/* Holds the type at full contrast over the brightest part of the plate. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(7, 7, 8, .9) 0%, rgba(7, 7, 8, .66) 32%, rgba(7, 7, 8, .16) 62%, rgba(7, 7, 8, 0) 100%),
    linear-gradient(to bottom, rgba(7, 7, 8, .7) 0%, rgba(7, 7, 8, .12) 26%, rgba(7, 7, 8, .22) 70%, var(--ink) 100%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: min(100% - var(--pad) * 2, var(--wrap));
  margin-inline: auto;
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding-block: calc(var(--nav-h) + 2rem) 4rem;
}

.hero__inner > * { max-width: min(100%, 42rem); }

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

.film__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(7, 7, 8, .92) 0%, rgba(7, 7, 8, .74) 30%, rgba(7, 7, 8, .18) 62%, transparent 86%),
    linear-gradient(to bottom, rgba(7, 7, 8, .6) 0%, transparent 26%, transparent 58%, rgba(7, 7, 8, .82) 100%);
}

/* The scrim only exists to carry the closing plate, so it stays off the picture
   until the film resolves. */
.film__scrim { opacity: 0; transition: opacity .9s var(--ease); }
.film.is-resolved .film__scrim { opacity: 1; }

.film .film__hud { opacity: 1; }

/* Icon-only so no words sit over the picture. */
.film__skip {
  border: 0;
  padding: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  color: var(--muted-1);
}

.film__skip svg { width: 1.4rem; height: 1.4rem; }
.film__skip:hover { color: var(--cyan); }

/* --------------------------------------------------------- chapter overlays */

.film__chapters {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.film__chapter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(5rem, 13vh, 8.5rem);
  width: min(100% - var(--pad) * 2, var(--wrap));
  margin-inline: auto;
  display: grid;
  gap: 1rem;
  justify-items: start;
  opacity: 0;
  will-change: opacity, transform;
}

.film__chapter--end { opacity: 0; }

/* The closing plate is bottom-anchored, so a statement sized off viewport width
   alone runs off the top of a short window and clips its first line. Sizing it
   against height as well as width keeps the whole plate inside the stage. */
.film__chapter--end > * { max-width: min(100%, 46rem); }

.film__chapter--end .film__statement {
  font-size: clamp(1.9rem, min(4.6vw, 7vh), 4rem);
}

/* The plate spans the content grid so the copy sits on the page's left edge,
   clear of the intelligence core on the right; the lines cap themselves. */
.film__chapter > * { pointer-events: auto; max-width: min(100%, 42rem); }

.film__chapter .film__eyebrow { color: var(--cyan); }

.film__statement {
  display: block;
  margin: 0;
  font-size: var(--t-display);
  font-variation-settings: "wdth" 82, "wght" 650;
  letter-spacing: -.055em;
  line-height: .91;
  color: var(--ivory);
  text-wrap: balance;
}

.film__headline {
  margin: 0;
  display: grid;
  /* The statement sets tight at display size, so the supporting line needs a
     little clearance from its descenders. */
  gap: .85rem;
  max-width: 20ch;
}

/* The H1 carries the search-relevant sentence; the statement above it stays the
   loudest thing on the screen. */
.film__headline-sub {
  display: block;
  font-size: clamp(1.05rem, 1.8vw, 1.5rem);
  font-variation-settings: "wdth" 96, "wght" 450;
  letter-spacing: -.005em;
  line-height: 1.25;
  color: var(--ivory-dim);
  max-width: 26ch;
}

.film__chapter .film__lede { max-width: 30ch; }
.film__chapter .film__support { max-width: 42ch; }

.film__chapter-link {
  font: 500 var(--t-micro)/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  border-bottom: 1px solid var(--edge-1);
  padding-bottom: 4px;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}

.film__chapter-link:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------------------------------------------------- reduced motion / still */

.film--still { height: auto; }
.film--still .film__stage { position: relative; height: auto; min-height: 78svh; display: grid; }
.film--still .film__canvas,
.film--still .film__hud,
.film--still .film__scroll,
.film--still .film__skip { display: none; }
.film--still .film__chapters {
  position: relative;
  inset: auto;
  align-self: end;
  /* Clears the fixed navigation, which the sticky layout normally scrolls past. */
  padding-block: clamp(7rem, 18vh, 11rem) clamp(3rem, 9vh, 6rem);
}
.film--still .film__chapter { position: relative; bottom: auto; opacity: 1 !important; transform: none !important; }
.film--still .film__chapter:not(:first-child) { display: none; }
.film--still .film__strip { display: block; }

@media (prefers-reduced-motion: reduce) {
  .film__chapter:not(:first-child) { display: none; }
  .film__strip { display: block; }
}

/* ----------------------------------------------------------------- narrow up */

@media (max-width: 720px) {
  /* 180 mobile frames at ~3vh each. */
  :root { --film-scroll: 640vh; }

  /* The canvas fills the screen. The engine contains the 16:9 frame inside it
     and fills the remainder with a blurred extension of that same frame, so
     the film is full-bleed without the composition being cropped away. */
  .film__poster {
    object-fit: contain;
    background: var(--ink);
  }

  .film__chapter {
    bottom: clamp(4rem, 11vh, 6rem);
    gap: .75rem;
  }

  .film__statement { font-size: clamp(2.4rem, 12vw, 3.6rem); }
  .film__headline-sub { font-size: 1rem; }
  .film__chapter .film__support { font-size: .92rem; }

  /* The portrait crop puts the portal ring in the upper half, so the type sits
     below it on its own ground rather than across the brightest part. */
  .hero { align-items: end; }
  .hero__inner { padding-block: calc(var(--nav-h) + 1.5rem) clamp(2.5rem, 8vh, 4rem); }
  .hero__backdrop img { object-position: 50% 22%; }

  .hero__scrim {
    background: linear-gradient(to bottom,
      rgba(7, 7, 8, .66) 0%,
      rgba(7, 7, 8, .12) 20%,
      rgba(7, 7, 8, .2) 42%,
      rgba(7, 7, 8, .88) 62%,
      var(--ink) 78%);
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .film__chapter .film__support { display: none; }
}

/* Touch devices get comfortable targets without changing the desktop design. */
@media (pointer: coarse) {
  .btn--sm { min-height: 44px; }
  .nav__toggle { width: 2.75rem; height: 2.75rem; }
  .price__cta { display: inline-flex; align-items: center; min-height: 44px; }
}

/* The consent checkbox is injected into the contact form at runtime. */
.consent-check {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: var(--t-small);
  color: var(--muted);
}

.consent-check input { margin-top: .25rem; accent-color: var(--cyan); }
.consent-check a { color: var(--ivory-dim); text-decoration: underline; }
.consent-check a:hover { color: var(--cyan); }

/* ------------------------------------------- automation block inside #rast */
/* The growth path and the operational chain used to be two sections saying the
   same thing; the chain now runs underneath the stages in one story. */

.automation {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--edge);
}

.automation__title {
  margin: 0 0 .9rem;
  max-width: 22ch;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-variation-settings: "wdth" 92, "wght" 600;
  letter-spacing: -.025em;
  line-height: 1.05;
}

.automation__body { color: var(--muted); max-width: 46rem; }

.automation__media-pair {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid;
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
}

.automation__media-pair .automation__media { margin-top: 0; border: 0; }

.automation__actions { margin-top: 2rem; }

@media (min-width: 900px) {
  .automation__media-pair { grid-template-columns: 1fr 1fr; }
}
