/* Homepage: device stage. All rules scoped under .home-stage (prefix hs-).
   Two layouts: the plain stacked page (default, no script needed) and the live
   3D story, switched on when home-stage.js adds .hs--gl to the root. */

html:has(.home-stage) { scroll-behavior: auto; }
html:has(.home-stage) .body-inner { background: #E9E7E2; }
html:has(.home-stage) .ip-header:not(.ip-header--scrolled) { background: transparent; }
/* when the bar comes back over the story it wears the opening's colour, not white */
html:has(.home-stage) .ip-header { --ip-header-bg: #E9E7E2; }
/* the chat button waits for the loading screen to finish (class set in home-stage.js) */
html.hs-chat-wait #tidio-chat { visibility: hidden !important; }

.home-stage {
  --hs-stage-bg: #E9E7E2;
  --hs-night: var(--ip-ink-2);
  --hs-light: #F4F1EA;
  --hs-light-dim: rgba(244, 241, 234, 0.64);
  --hs-hair: rgba(244, 241, 234, 0.16);
  --hs-inset: 0px; /* extra side margin for the opening on wide screens */
  --hs-word-fs: min(calc((100vw - 2 * var(--hs-pad) - 2 * var(--hs-inset)) / var(--hs-word-em)), 560px);
  --hs-word-em: 4.35; /* width of "ELEMENTZ" in ems at this face and tracking */
  --hs-font: var(--ip-font-card); /* Space Grotesk, the owner's pick for headline and titles */
  --hs-pad: clamp(16px, 4vw, 56px);
  --hs-band: clamp(150px, 24svh, 240px);
  --hs-head: 65px;
  --hs-open: 0;
  display: block;
  color: var(--ip-ink);
  font-family: var(--ip-font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}
.home-stage *, .home-stage *::before, .home-stage *::after { box-sizing: border-box; }
.home-stage section { padding: 0; margin: 0; overflow: visible; }
.home-stage p {
  margin: 0;
  font-family: var(--ip-font-body);
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  color: var(--ip-ink-2);
}
.home-stage h1, .home-stage h2, .home-stage h3 {
  margin: 0;
  font-family: var(--hs-font);
  font-weight: 500;
  color: var(--ip-ink);
  letter-spacing: -0.04em;
}
.home-stage ol, .home-stage ul { margin: 0; padding: 0; list-style: none; }
.home-stage img { display: block; max-width: 100%; height: auto; }
.home-stage a { color: inherit; }
.home-stage a:focus-visible { outline: 2px solid var(--ip-accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- shared pieces ---------- */
.hs-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 5px 5px 5px 24px;
  border-radius: var(--ip-r-pill);
  font-family: var(--ip-font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease;
}
.hs-btn__nub {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.25s ease;
}
.hs-btn__nub svg { width: 16px; height: 16px; display: block; }
.hs-btn:hover .hs-btn__nub { transform: rotate(-45deg); }
.hs-btn--primary { background: var(--ip-ink-2); color: #fff !important; }
.hs-btn--primary .hs-btn__nub { background: var(--ip-accent); color: var(--ip-ink-2); }
.hs-btn--primary:hover { background: #000; }
.hs-btn:active { transform: scale(0.97); }
.hs-btn:focus-visible { outline-offset: 3px; border-radius: var(--ip-r-pill); }

.hs-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--hs-hair);
  border-radius: var(--ip-r-pill);
  color: var(--hs-light) !important;
  font-family: var(--ip-font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.hs-pill:hover { background: var(--ip-accent); border-color: var(--ip-accent); color: var(--ip-ink-2) !important; }

/* ---------- story ----------
   A fixed, transparent 3D canvas sits between the section backgrounds and the
   text. The opening is light; the page darkens through .hs-drop while the
   device falls, and each service chapter is a tall dark section whose text
   sticks while the matching part poses beside it. Without .hs--gl (no WebGL,
   reduced motion, data saver) the same markup is a plain page with stills. */
.hs-gl {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100lvh;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hs-gl canvas { display: block; width: 100%; height: 100%; }
.hs--gl-ready .hs-gl { visibility: visible; opacity: 1; }
.hs--gl.hs--gl-off .hs-gl { visibility: hidden; }

.hs-story { position: relative; background: var(--hs-stage-bg); }

/* opening */
.home-stage .hs-hero {
  position: relative;
  background: transparent;
  z-index: auto; /* the theme gives sections a z-index, which would lift the whole opening above the 3D canvas */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--hs-band);
  height: calc(100svh - var(--hs-head));
  min-height: 460px;
}
.hs-poster {
  display: block;
  grid-area: 1 / 1;
  position: relative;
  height: 100%;
  min-height: 0;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  overflow: clip;
  transition: opacity 0.5s ease;
}
/* The still is a square capture of the live device with 15% clear space on each side.
   Its size repeats the sum home-stage.js uses to size the 3D device (layout(): share of the
   box width or height, divided by 1.12), so the two sit on top of each other. */
.hs-poster { container-type: size; --hs-dev-w: 82; --hs-dev-h: 80; }
.hs-poster img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(min(var(--hs-dev-w) * 1cqw, var(--hs-dev-h) * 1cqh) / 1.12 * 1.3);
  max-width: none;
  height: auto;
  aspect-ratio: 1;
  translate: -50% -50%;
}
.hs--gl-ready .hs-poster { opacity: 0; }

.hs-wordmark {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  position: relative;
  font-family: var(--ip-font-display);
  font-weight: 700;
  /* sized so the word runs from the left page margin to the right one */
  font-size: var(--hs-word-fs);
  line-height: 0.8;
  letter-spacing: -0.03em;
  left: -0.012em; /* optical: centres the ink, not the letter boxes, so the E and Z sit on the page margins */
  white-space: nowrap;
  color: #F8F7F4;
  user-select: none;
  pointer-events: none;
  will-change: transform, opacity;
  opacity: calc(1 - var(--hs-open));
}
.hs-wordmark--back { z-index: 0; }
.hs-wordmark--front {
  z-index: 2;
  clip-path: inset(-10% 0 -10% 62.75%); /* the gap between the second E and the N */
}
/* Loading screen: covers the page in the opening's own colour. The word is drawn twice: a faint
   copy, and an ink copy revealed from the bottom by --hs-p (0 to 1) with a moving wave for its
   top edge. It is the same word, face and size as the big word of the opening, so the hand-over
   is one movement: the word glides to where the opening's word sits, turns that word's colour,
   and the screen dissolves around it (home-stage.js sets the distance in --hs-to-x / --hs-to-y). */
.hs-loader {
  --hs-p: 0;
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  background: var(--hs-stage-bg);
  overflow: hidden;
  animation: hs-loader-bail 0.5s 10s forwards; /* lets go by itself if the script never arrives */
}
.hs-loader__word {
  position: relative;
  font-family: var(--ip-font-display);
  font-weight: 700;
  font-size: var(--hs-word-fs);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  transition: transform 0.85s cubic-bezier(0.65, 0, 0.2, 1);
  will-change: transform;
}
.hs-loader__base { display: block; color: rgba(20, 23, 28, 0.1); transition: color 0.7s ease; }
.hs-loader__fill {
  position: absolute;
  inset: 0;
  color: transparent;
  /* the wave strip rides on top of a solid block; both are cut to the letters */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 20' preserveAspectRatio='none'%3E%3Cpath d='M0 10Q40-2 80 10T160 10V20H0Z' fill='%2314171C'/%3E%3C/svg%3E"),
    linear-gradient(var(--ip-ink-2), var(--ip-ink-2));
  background-repeat: repeat-x, no-repeat;
  background-size: 1.6em 0.16em, 100% 100%;
  background-position-x: 0, 0;
  /* the letters' ink runs from about 0.1em to 0.9em of the line box */
  background-position-y: calc((0.92 - 0.78 * var(--hs-p)) * 1em - 0.15em), calc((0.92 - 0.78 * var(--hs-p)) * 1em);
  -webkit-background-clip: text;
  background-clip: text;
  animation: hs-loader-wave 1.4s linear infinite;
  transition: opacity 0.7s ease;
}
.hs-loader__note {
  position: absolute;
  right: 0.04em;
  top: 100%;
  margin-top: 4px;
  font-family: var(--ip-font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(20, 23, 28, 0.62);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s ease;
}
.hs-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.6s ease 0.75s, visibility 0s 1.35s; animation: none; }
.hs-loader.is-done .hs-loader__word { transform: translate(var(--hs-to-x, 0px), var(--hs-to-y, 0px)); }
.hs-loader.is-done .hs-loader__base { color: #F8F7F4; } /* the colour of the opening's word */
.hs-loader.is-done .hs-loader__fill { opacity: 0; }
.hs-loader.is-done .hs-loader__note { opacity: 0; }
.hs-loader.is-off { display: none; }
html.hs-loading-on { overflow: hidden; }
@keyframes hs-loader-wave { to { background-position-x: -1.6em, 0; } }
@keyframes hs-loader-bail { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .hs-loader { display: none; } }
/* until the live device is ready nothing can switch the scene text on, so it is simply shown */
.hs--gl:not(.hs--gl-ready) .hs-chapter__text > * { opacity: 1; transform: none; }

/* The shimmer: once the loading word has landed and the opening is showing, a glint crosses the
   opening's word once. It is drawn on both copies of the word (the front copy is cut to its last
   letters), so it runs behind the device and comes out in front of it. On pale letters plain
   white light would not show, so the bright core has a faint shadow on either side. */
.hs-wordmark::after {
  content: "ELEMENTZ";
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(105deg,
    rgba(20, 23, 28, 0) 41%, rgba(20, 23, 28, 0.2) 46.5%, #fff 50%, rgba(20, 23, 28, 0.2) 53.5%, rgba(20, 23, 28, 0) 59%) no-repeat;
  background-size: 300% 100%;
  background-position: 100% 0; /* the whole band, shadow included, is off the left end of the word */
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
}
.hs--landed .hs-wordmark::after { animation: hs-word-shine 1.5s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
@keyframes hs-word-shine { to { background-position: 0% 0; } } /* and off the right end */

/* the headline is always three lines, broken where it reads best */
.hs-hero__title > span { display: block; white-space: nowrap; }
.hs-hero__title, .hs-hero__side {
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
  opacity: calc(1 - var(--hs-open) * 1.4);
  transform: translateY(calc(var(--hs-open) * -32px));
}
.home-stage .hs-hero__title {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: start;
  max-width: 17ch;
  margin: clamp(10px, 3vh, 40px) var(--hs-pad) 0;
  font-family: var(--ip-font-body);
  font-size: clamp(24px, 2.3vw, 42px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.hs-hero__side {
  grid-area: 2 / 1;
  align-self: end;
  justify-self: end;
  display: grid;
  gap: 22px;
  justify-items: start;
  width: min(340px, 100%);
  margin: 0 var(--hs-pad) clamp(28px, 6vh, 64px);
}
.home-stage .hs-hero__lede { font-size: 15px; line-height: 1.5; color: #3B3E44; }
/* wide screens: the device takes the whole opening and the text sits in its corners */
@media (min-width: 1360px) and (min-aspect-ratio: 4/5) and (min-height: 521px) {
  .hs-poster, .hs-wordmark { grid-row: 1 / -1; }
  .hs-poster { --hs-dev-w: 44; --hs-dev-h: 64; }
  .hs-hero__side { width: 310px; }
}
/* landscape screens: the word is drawn a little inside the page margins, the headline sits
   just above its first letters, and the side text ends where the word ends */
@media (min-width: 1024px) and (min-aspect-ratio: 4/5) and (min-height: 521px) {
  .home-stage { --hs-inset: 5vw; }
  .home-stage .hs-hero__title {
    align-self: center;
    max-width: none;
    margin: 0 calc(var(--hs-pad) + var(--hs-inset));
    /* up by half its own height, half the capital height of the word, and a gap */
    translate: 0 calc(-50% - var(--hs-word-fs) * 0.33 - clamp(14px, 2.4vh, 30px));
  }
  .hs-hero__side { margin-right: max(calc(var(--hs-pad) + var(--hs-inset)), calc(var(--hs-pad) + 96px)); } /* ends with the Z; never under the chat button */
}
@media (min-width: 1360px) and (min-aspect-ratio: 4/5) and (min-height: 521px) {
  .home-stage .hs-hero__title { grid-row: 1 / -1; }
}

/* the fall: light to dark */
.hs-drop {
  height: 110svh;
  background: linear-gradient(to bottom, var(--hs-stage-bg) 0%, #8A8884 38%, var(--hs-night) 82%);
}
.home-stage:not(.hs--gl) .hs-drop { height: 96px; }

/* chapters */
.hs-chapters { background: var(--hs-night); }
.hs-chapter { position: relative; }
.hs-chapter__ghost {
  position: sticky;
  top: 34svh;
  height: 0;
  z-index: 0;
  font-family: var(--ip-font-display);
  font-weight: 700;
  font-size: min(17vw, 300px);
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  color: rgba(244, 241, 234, 0.035);
  user-select: none;
  pointer-events: none;
  overflow: visible;
}
.hs-chapter__text {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 20px;
  align-content: start;
  justify-items: start;
  width: min(40vw, 480px);
}
.home-stage .hs-chapter__title {
  font-size: clamp(38px, 4.6vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--hs-light);
}
.home-stage .hs-chapter__body {
  max-width: 30ch;
  color: var(--hs-light-dim);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.5;
}
.hs-chapter__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px !important; }
.home-stage .hs-chapter__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--hs-hair);
  border-radius: var(--ip-r-pill);
  color: var(--hs-light);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.home-stage .hs-chapter__links a:hover { background: var(--ip-accent); border-color: var(--ip-accent); color: var(--ip-ink-2); }

/* chapters: plain page (no 3D) */
.home-stage:not(.hs--gl) .hs-chapter {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: clamp(40px, 7vw, 96px) var(--hs-pad);
}
.home-stage:not(.hs--gl) .hs-chapter__ghost { display: none; }
.home-stage:not(.hs--gl) .hs-chapter__still img { width: min(100%, 620px); margin: 0 auto; }
.home-stage:not(.hs--gl) .hs-chapter__text { width: auto; max-width: 520px; }
@media (min-width: 768px) {
  .home-stage:not(.hs--gl) .hs-chapter { grid-template-columns: 1.2fr 1fr; gap: 48px; }
  .home-stage:not(.hs--gl) .hs-chapter:nth-child(even) .hs-chapter__still { order: 2; }
}

/* chapters: live 3D */
/* each scene is short enough that the next one starts within a few wheel notches */
.hs--gl .hs-chapter { min-height: 112svh; padding: 0 var(--hs-pad) 28svh; }
.hs--gl .hs-chapter__still { display: none; }
.hs--gl .hs-chapter__text { position: sticky; top: 32svh; }
.hs--gl .hs-chapter:nth-child(even) .hs-chapter__text { margin-left: auto; }
.hs--gl .hs-chapter__text > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hs--gl .hs-chapter.is-active .hs-chapter__text > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 0.8, 0.2, 1);
}
.hs--gl .hs-chapter.is-active .hs-chapter__text > :nth-child(2) { transition-delay: 0.08s; }
.hs--gl .hs-chapter.is-active .hs-chapter__text > :nth-child(3) { transition-delay: 0.16s; }
.hs--gl .hs-chapter__ghost { opacity: 0; transition: opacity 0.6s ease; }
.hs--gl .hs-chapter.is-active .hs-chapter__ghost { opacity: 1; }

@media (max-width: 1023px) {
  .hs-hero__side { justify-self: start; width: min(420px, calc(100% - 2 * var(--hs-pad))); }
}
@media (max-width: 768px) {
  .home-stage { --hs-head: 66px; }
}
/* narrow or portrait: the part poses in the upper screen, the text holds near the bottom */
@media (max-width: 768px), (max-aspect-ratio: 4/5) {
  /* how far above the bottom of the screen the scene text starts: as low as the tallest text
     block allows, so the part above it gets the room */
  .home-stage { --hs-text-drop: 256px; }
  .hs--gl .hs-chapter__text,
  .hs--gl .hs-chapter:nth-child(even) .hs-chapter__text {
    top: calc(100svh - var(--hs-text-drop));
    width: auto;
    max-width: 520px;
    min-height: 200px;
    margin: 0;
    gap: 12px;
  }
  .home-stage .hs-chapter__title { font-size: clamp(32px, 8.6vw, 48px); }
  .home-stage .hs-chapter__body { font-size: 16px; max-width: 34ch; }
  .hs-chapter__links { margin-top: 0 !important; }
  /* the ghost word pins at the same moment as the text and is drawn higher up, behind the part;
     pinned on its own it used to travel up through the title on its way there */
  .hs-chapter__ghost { top: calc(100svh - var(--hs-text-drop)); translate: 0 calc(24svh - 100svh + var(--hs-text-drop)); font-size: 16.5vw; }
  .hs--gl .hs-chapter { min-height: 106svh; padding-bottom: 22svh; }
  /* the last scene hands straight over to the next section: no empty screen in between */
  .hs--gl .hs-chapter:last-child { padding-bottom: 2svh; }
  /* the fall is shorter here: the device is small on an upright screen and the stage is empty around it */
  .hs--gl .hs-drop { height: 78svh; }
}
/* tablets held upright: move the device down, clear of the headline */
@media (min-width: 561px) and (max-aspect-ratio: 4/5) {
  .hs-poster, .hs-wordmark { translate: 0 90px; }
}
/* below about 96px the face switches to its text-size drawing, which runs wider */
@media (max-width: 480px) {
  .home-stage { --hs-word-em: 4.5; }
}
@media (max-width: 560px) {
  .home-stage { --hs-band: clamp(190px, 29svh, 260px); }
  .home-stage .hs-hero__title { max-width: 18ch; font-size: clamp(22px, 6.2vw, 28px); }
  .hs-hero__side { gap: 14px; width: auto; justify-self: stretch; margin-bottom: 22px; }
  .hs-hero__lede { font-size: 14px !important; line-height: 1.45 !important; max-width: 36ch; }
  /* the device is as wide as the word here, so behind its middle the word could not be read.
     The device is a little smaller and lower, and the word rests on its top edge, under the
     headline: only the feet of the middle letters go behind the rim. */
  .hs-poster { --hs-dev-w: 76; translate: 0 64px; }
  .hs-wordmark {
    --hs-title-fs: clamp(22px, 6.2vw, 28px);
    translate: 0 max(
      /* 14px above the top of the device (radius: 76% of the width / 2.24) */
      calc(50px - 33.9vw),
      /* but never into the headline: its top margin, three lines, a gap, half the capital height */
      calc(clamp(10px, 3vh, 40px) + 3.24 * var(--hs-title-fs) + 10px + 0.36 * var(--hs-word-fs) - (100svh - var(--hs-head) - var(--hs-band)) / 2)
    );
  }
}
/* phones on their side */
@media (orientation: landscape) and (max-height: 520px) {
  .home-stage .hs-hero { grid-template-columns: 56% 44%; grid-template-rows: minmax(0, 1fr); min-height: 0; }
  .hs-wordmark { display: none; }
  .hs-poster { grid-area: 1 / 1; }
  .home-stage .hs-hero__title { grid-area: 1 / 2; align-self: start; margin: 12px var(--hs-pad) 0 0; font-size: clamp(22px, 4.6vh + 8px, 34px); }
  .hs-hero__side { grid-area: 1 / 2; align-self: end; justify-self: start; width: auto; margin: 0 var(--hs-pad) 14px 0; gap: 10px; }
  .hs-btn { min-height: 44px; }
  .hs-btn__nub { width: 34px; height: 34px; }
  .hs-hero__lede { font-size: 13px !important; line-height: 1.4 !important; }
  .hs--gl .hs-chapter__text { top: 22svh; width: 42vw; gap: 8px; }
  .home-stage .hs-chapter__title { font-size: clamp(26px, 9vh, 40px); }
  .home-stage .hs-chapter__body { font-size: 14px; }
  .hs-chapter__ghost { display: none; }
}

/* sections after the story sit above the canvas */
.hs-nz, .hs-clients, .hs-close { position: relative; z-index: 3; }

/* ---------- after the story: one continuous night stage down to the footer ---------- */
.hs-nz, .hs-clients, .hs-close {
  background: var(--hs-night);
  color: var(--hs-light);
  padding-left: var(--hs-pad) !important;
  padding-right: var(--hs-pad) !important;
}
.home-stage .hs-nz p, .home-stage .hs-clients p, .home-stage .hs-close p { color: var(--hs-light-dim); }
.home-stage .hs-h2 {
  font-size: clamp(42px, 7.6vw, 120px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--hs-light);
}

/* Nucleolenz */
.hs-nz { display: grid; gap: clamp(36px, 5vw, 72px); padding-top: clamp(24px, 6vw, 96px) !important; padding-bottom: clamp(64px, 9vw, 130px) !important; }
.hs-nz__intro { display: grid; gap: 24px; align-items: end; }
.hs-nz__lede { display: grid; gap: 20px; justify-items: start; max-width: 48ch; }
/* optical: the N's upright sits on the cards' left edge, not its side bearing */
.hs-nz .hs-h2 { margin-left: -0.045em; }
.home-stage .hs-nz__lede p { font-size: clamp(16px, 1.3vw, 19px); }
.hs-nz__list { display: grid; gap: clamp(12px, 1.4vw, 20px); }
.hs-nz__item {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 300px;
  border-radius: 20px;
  overflow: hidden;
  background: #1B1F26;
  isolation: isolate;
}
.hs-nz__media { position: absolute; inset: 0; z-index: -1; }
.hs-nz__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(0.16, 0.8, 0.2, 1); }
.hs-nz__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 14, 18, 0.92) 0%, rgba(12, 14, 18, 0.5) 38%, rgba(12, 14, 18, 0) 68%);
}
.hs-nz__item:hover .hs-nz__media img { transform: scale(1.045); }
.hs-nz__text { display: grid; gap: 8px; padding: clamp(18px, 2.2vw, 30px); max-width: 56ch; }
.home-stage .hs-nz__title { font-size: clamp(21px, 2.1vw, 30px); font-weight: 500; letter-spacing: -0.03em; color: #fff; overflow-wrap: anywhere; }
.hs-nz__title a { text-decoration: none; color: inherit; }
.hs-nz__title a::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
.hs-nz__title a:focus-visible { outline: none; }
.hs-nz__item:has(a:focus-visible) { outline: 2px solid var(--ip-accent); outline-offset: 3px; }
.home-stage .hs-nz__desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 15px; color: rgba(255, 255, 255, 0.72); }
@media (min-width: 768px) {
  /* the intro row uses the same two columns as the cards, so the paragraph starts on the
     same line as the right-hand cards and the title on the same line as the tall one */
  .hs-nz__intro, .hs-nz__list { grid-template-columns: 1.35fr 1fr; column-gap: clamp(12px, 1.4vw, 20px); }
  .hs-nz__lede { padding-left: clamp(18px, 2.2vw, 30px); }
  .hs-nz__list { grid-auto-rows: minmax(260px, 34vh); }
  .hs-nz__item:first-child { grid-row: span 2; }
  .hs-nz__item:only-child { grid-column: 1 / -1; grid-row: auto; }
  .hs-nz__item:first-child:nth-last-child(2) { grid-row: auto; }
}

/* clients: one row of logos, straight on the dark stage, that scrolls on its own.
   Every logo is fitted into the same box so they read as one size. The logo files
   need transparent backgrounds (set in Wagtail); nothing here hides a white box. */
.home-stage .hs-clients { display: block; padding: 0 0 clamp(40px, 6vw, 90px) !important; }
.hs-clients__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hs-clients__marquee { overflow: hidden; }
.hs-clients__track { display: flex; width: max-content; animation: hs-marquee 40s linear infinite; }
.hs-clients__marquee:hover .hs-clients__track,
.hs-clients__marquee:focus-within .hs-clients__track { animation-play-state: paused; }
.hs-clients__list {
  --hs-logo: clamp(84px, 9vw, 132px);
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-around;
  min-width: 100vw;
  gap: clamp(48px, 7vw, 120px);
  padding: 24px clamp(24px, 3.5vw, 60px) !important;
}
.hs-clients__list li { display: flex; flex: none; align-items: center; justify-content: center; width: var(--hs-logo); height: var(--hs-logo); }
.hs-clients__list a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.hs-clients__list img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
@keyframes hs-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .hs-clients__track { width: auto; display: block; }
  .hs-clients__list { flex-wrap: wrap; justify-content: center; min-width: 0; }
  .hs-clients__list[aria-hidden="true"] { display: none; }
}

/* closing: the night stage warms into the footer colour */
.hs-close {
  display: grid;
  gap: 22px;
  justify-items: start;
  /* no button here: the footer's own contact button is right below, so the heading sits low, close to it */
  padding-top: clamp(120px, 17vw, 300px) !important;
  padding-bottom: clamp(20px, 3vw, 48px) !important;
  background: linear-gradient(to bottom, var(--hs-night) 0%, #2A1719 55%, var(--ip-footer) 100%);
}
.home-stage .hs-close__title { font-size: clamp(42px, 7.6vw, 120px); font-weight: 500; line-height: 0.92; letter-spacing: -0.045em; color: var(--hs-light); }
.home-stage .hs-close__text { max-width: 40ch; margin-bottom: 0; font-size: clamp(16px, 1.3vw, 19px); }

/* ---------- pointer (home-pointer.js) ---------- */
.hs-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2147483000;
  opacity: 0;
  /* white + difference: reads dark on the light stage and light on the night sections */
  mix-blend-mode: difference;
  transition: opacity 0.2s ease;
}
.hs-cursor::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  transform: scale(0.23);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}
.hs-cursor.is-visible { opacity: 1; }
.hs-cursor.is-link::before { transform: scale(1); background: transparent; box-shadow: inset 0 0 0 2px #fff; }
html.hs-cursor-on, html.hs-cursor-on * { cursor: none !important; }

@media (prefers-reduced-motion: reduce) {
  .home-stage *, .home-stage *::before, .home-stage *::after { transition: none !important; animation: none !important; }
}
