/* ------------------------------------------------------------------
   Home page. Uses the site's theme variables, so every section follows
   the visitor's light or dark choice. 1rem = 10px in this theme.
   ------------------------------------------------------------------ */
.page-home {
  --hx-gutter: 6rem;
  --hx-blue: #0061ff;
  --hx-radius: clamp(2.4rem, 3vw, 4rem);
}
.page-home {
  --hx-bg: #ffffff; /* the hero's own black and white, deeper than the page colours */
}
[color-scheme="dark"] .page-home {
  --hx-blue: #2c7dff;
  --hx-bg: #050506;
}

.hx-wrap {
  width: 100%;
  max-width: 192rem; /* the theme's own container: wide screens centre it, the header stays full width */
  margin: 0 auto;
  padding: 0 var(--hx-gutter);
}

.hx-eyebrow {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--t-medium);
}
.hx-eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 0.9rem;
  height: 0.9rem;
  background: var(--hx-blue);
}
.hx-h2 {
  margin: 1.8rem 0 0;
  font-family: var(--_font-accent);
  font-size: clamp(3.8rem, 6vw, 10rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--t-bright);
}
.hx-h2 em {
  font-style: normal;
  color: var(--hx-blue);
}

/* Buttons */
.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 5.6rem;
  padding: 0 2.8rem;
  border: 1px solid var(--t-bright);
  border-radius: 99rem;
  background: transparent;
  color: var(--t-bright);
  font-size: 1.6rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.hx-btn i {
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.hx-btn:hover {
  background: var(--t-bright);
  border-color: var(--t-bright);
  color: var(--base);
}
.hx-btn:hover i {
  transform: translate(2px, -2px);
}
.hx-btn--solid {
  background: var(--hx-blue);
  border-color: var(--hx-blue);
  color: #fff;
}
.hx-btn--solid:hover {
  background: var(--t-bright);
  border-color: var(--t-bright);
  color: var(--base);
}

/* ---------- Hero ---------- */
.hx {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(9.6rem, 12vh, 13rem) 0 clamp(1.8rem, 2.6vh, 3.2rem);
  overflow: hidden;
  isolation: isolate;
  background: var(--hx-bg);
}
.hx .hx-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.hx__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hx__field canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.hx__field.is-live canvas {
  opacity: 1;
}
@media only screen and (max-width: 991px) {
  .hx__field::after {
    background: linear-gradient(to bottom, var(--hx-bg) 0%, color-mix(in srgb, var(--hx-bg) 50%, transparent) 40%, color-mix(in srgb, var(--hx-bg) 74%, transparent) 72%, var(--base) 100%);
  }
}
/* Melts into the page at the top and bottom, and keeps the text side calm. */
.hx__field::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--hx-bg) 0%, transparent 15%, transparent 78%, var(--base) 100%),
    linear-gradient(to right, color-mix(in srgb, var(--hx-bg) 66%, transparent) 0%, color-mix(in srgb, var(--hx-bg) 34%, transparent) 36%, transparent 56%);
}
.hx__pixels {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  visibility: hidden;
}
.hx__pixels.is-leaving {
  opacity: 0;
  transition: opacity 0.42s ease;
}
.hx__main {
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 0;
  padding-bottom: clamp(2.4rem, 4.4vh, 4.8rem);
}
.hx__copy {
  position: relative;
  z-index: 2;
}
.hx__title {
  margin: clamp(1.6rem, 2.4vh, 2.8rem) 0 0;
  font-family: var(--_font-accent);
  font-size: clamp(5.6rem, min(6.1vw, 13vh), 12rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--t-bright);
}
.hx__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
  white-space: nowrap;
}
.hx__line > span {
  display: block;
  animation: hx-rise 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
.hx__line--px > span {
  animation: none;
  transition: opacity 0.42s ease;
}
.hx__line--px.px-live > span {
  opacity: 0;
  transition: none;
}
.px-pending .hx__line--px > span {
  opacity: 0;
  animation: px-failsafe 0.4s 6s forwards;
}
@keyframes px-failsafe {
  to {
    opacity: 1;
  }
}
.hx__title em {
  font-style: normal;
  color: var(--hx-blue);
}
@keyframes hx-rise {
  from {
    transform: translateY(108%);
  }
}
.hx__lead {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(1.6rem, 1.2vw, 1.9rem);
  line-height: 1.42;
  color: var(--t-bright);
}
.hx__actions {
  display: flex;
  gap: 1rem;
}
@keyframes hx-fade {
  from {
    opacity: 0;
    transform: translateY(1.6rem);
  }
}
.hx__foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1.25fr);
  gap: 2rem 4rem;
  align-items: center;
  margin-top: clamp(1.4rem, 2vh, 2.4rem);
  padding-top: clamp(1.6rem, 2.4vh, 2.6rem);
  border-top: 1px solid var(--st-muted);
  animation: hx-fade 0.9s 0.3s both;
}
.hx__stats {
  display: flex;
  justify-content: flex-end;
  gap: clamp(2.4rem, 3vw, 5rem);
  margin: 0;
}
.hx__stats div {
  display: flex;
  flex-direction: column-reverse;
  margin: 0;
}
.hx__stats dt {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--t-medium);
  white-space: nowrap;
}
.hx__stats dd {
  margin: 0;
  font-family: var(--_font-accent);
  font-size: clamp(2.6rem, 2.3vw, 3.8rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--t-bright);
}

/* ---------- Client logos ---------- */
.hx-logos {
  padding: clamp(3.2rem, 4vw, 5.6rem) 0;
  overflow: hidden;
}
.hx-logos__label {
  margin: 0 0 2.8rem;
  padding: 0 max(var(--hx-gutter), calc((100vw - 174rem) / 2));
  font-size: 1.4rem;
  color: var(--t-medium);
}
.hx-logos__row {
  display: flex;
  width: max-content;
  animation: hx-slide 44s linear infinite;
  -webkit-mask-image: none;
}
.hx-logos:hover .hx-logos__row {
  animation-play-state: paused;
}
.hx-logos__set {
  display: flex;
  align-items: center;
  gap: clamp(5.6rem, 7vw, 11rem);
  padding-right: clamp(5.6rem, 7vw, 11rem);
}
.hx-logo {
  display: block;
  height: clamp(3rem, 3vw, 4.2rem);
  aspect-ratio: var(--ratio);
  background: var(--t-bright);
  opacity: 0.72;
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  transition: opacity 0.3s;
}
.hx-logo:hover {
  opacity: 1;
}
@keyframes hx-slide {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Statement + glass videos ---------- */
.hx-statement {
  position: relative;
  padding: clamp(7rem, 10vw, 16rem) 0 clamp(5rem, 6vw, 9rem);
}
.hx-statement__top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 4fr);
  gap: 3.2rem;
  align-items: start;
}
.hx-statement__text {
  margin: 0;
  max-width: 21em;
  font-family: var(--_font-accent);
  font-size: clamp(3rem, 4.3vw, 7.2rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--t-bright);
}
.hx-statement__link {
  margin-top: clamp(2.8rem, 3vw, 4.4rem);
}
.hx-chrome {
  position: absolute;
  top: 3.4rem;
  left: -1.6rem;
  width: clamp(17rem, 17vw, 29rem);
  aspect-ratio: 1;
  pointer-events: none;
}
.hx-chrome img,
.hx-chrome canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hx-chrome img {
  padding: 12%;
  object-fit: contain;
}
.hx-chrome canvas {
  opacity: 0;
  transition: opacity 0.4s;
}
.hx-chrome.is-live img {
  opacity: 0;
}
.hx-chrome.is-live canvas {
  opacity: 1;
}
.hx-glass {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 1.4vw, 2.4rem);
  margin-top: clamp(5rem, 6.5vw, 11rem);
}
.hx-glass__item {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--hx-radius);
  background: var(--base-tint);
}
.hx-glass__item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hx-loop {
  margin: 0;
  background-size: cover;
  background-position: center;
}
.hx-loop--form {
  background-image: url(/img/loops/form-light.webp);
}
.hx-loop--build {
  background-image: url(/img/loops/build-light.webp);
}
[color-scheme="dark"] .hx-loop--form {
  background-image: url(/img/loops/form-dark.webp);
}
[color-scheme="dark"] .hx-loop--build {
  background-image: url(/img/loops/build-dark.webp);
}
/* Keeps the caption clear of the artwork, which sits on the right of every clip. */
.hx-loop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, color-mix(in srgb, var(--hx-bg) 82%, transparent) 0%, color-mix(in srgb, var(--hx-bg) 50%, transparent) 30%, transparent 50%);
  pointer-events: none;
}
.hx-loop figcaption {
  position: absolute;
  left: clamp(1.8rem, 2.4vw, 3.6rem);
  bottom: clamp(1.6rem, 2.2vw, 3.2rem);
  z-index: 1;
  width: 40%;
  font-family: var(--_font-accent);
  font-size: clamp(1.5rem, 1.55vw, 2.8rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--t-bright);
  text-wrap: balance;
}

/* ---------- Section headers ---------- */
.hx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2.4rem;
  margin-bottom: clamp(3.6rem, 4.6vw, 7rem);
}

/* ---------- Work ---------- */
.hx-work {
  padding: clamp(5rem, 7vw, 11rem) 0 0;
}

/* ---------- Services bento ---------- */
.hx-services {
  position: relative;
  padding: clamp(7rem, 9vw, 14rem) 0;
}
.hx-services__knot {
  position: absolute;
  top: 2rem;
  right: 26vw;
  z-index: -1;
  width: clamp(12rem, 15vw, 26rem);
  will-change: transform;
}
.hx-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.2rem, 1.4vw, 2.4rem);
}
.hx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-column: span 4;
  min-height: clamp(44rem, 37vw, 62rem);
  padding: clamp(2.4rem, 2.4vw, 4rem);
  overflow: hidden;
  border-radius: var(--hx-radius);
  background: var(--base-tint);
  color: var(--t-bright);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.hx-card:hover {
  transform: translateY(-6px);
}
.hx-card--wide {
  grid-column: span 6;
}
.hx-card__n {
  font-size: 1.4rem;
  color: var(--t-medium);
}
.hx-card h3 {
  margin: 1.2rem 0 1.2rem;
  max-width: 13em;
  font-family: var(--_font-accent);
  font-size: clamp(2.6rem, 2.5vw, 4rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--t-bright);
}
.hx-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 36ch;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--t-medium);
}
.hx-card img {
  position: absolute;
  right: -3%;
  bottom: -5%;
  width: min(68%, 34rem);
  height: auto;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.hx-card--wide img {
  width: min(56%, 40rem);
}
.hx-card:hover img {
  transform: scale(1.06) translateY(-1%);
}
.hx-card__go {
  position: absolute;
  left: clamp(2.4rem, 2.4vw, 4rem);
  bottom: clamp(2.4rem, 2.4vw, 4rem);
  display: grid;
  place-items: center;
  width: 4.8rem;
  height: 4.8rem;
  border-radius: 50%;
  background: var(--base);
  color: var(--t-bright);
  font-size: 1.8rem;
  transition: background 0.3s, color 0.3s;
}
.hx-card:hover .hx-card__go {
  background: var(--hx-blue);
  color: #fff;
}

/* ---------- Responsive ---------- */
@media only screen and (max-width: 767px) {
  .page-home {
    --hx-gutter: 3rem;
  }
}
@media only screen and (min-width: 1600px) {
  .page-home {
    --hx-gutter: 9rem;
  }
}
@media only screen and (max-width: 1199px) {
  .hx__foot {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hx__stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .hx-card,
  .hx-card--wide {
    grid-column: span 6;
  }
  .hx-card:last-child {
    grid-column: 1 / -1;
  }
}
@media only screen and (max-width: 991px) {
  .hx {
    padding-top: 9.6rem;
  }
  .hx__title {
    font-size: min(10.3vw, 8.4rem);
  }
}
@media only screen and (max-width: 767px) {
  .hx__foot {
    grid-template-columns: minmax(0, 1fr);
  }
  .hx__actions {
    flex-wrap: wrap;
  }
  .hx__actions .hx-btn {
    flex: 1 1 auto;
  }
  .hx__stats {
    justify-content: space-between;
    gap: 1.6rem;
  }
  .hx__stats dt {
    white-space: normal;
    font-size: 1.25rem;
    line-height: 1.25;
  }
  .hx-statement__top {
    grid-template-columns: minmax(0, 1fr);
  }
  .hx-chrome {
    position: relative;
    top: auto;
    left: auto;
    width: min(62vw, 26rem);
    margin: 0 auto;
    grid-row: 2;
  }
  .hx-glass {
    grid-template-columns: minmax(0, 1fr);
  }
  .hx-card,
  .hx-card--wide,
  .hx-card:last-child {
    grid-column: 1 / -1;
    min-height: 46rem;
  }
  .hx-services__knot {
    right: 4vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx__line > span,
  .hx__foot {
    animation: none;
  }
  .hx-logos__row {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }
}

/* Selected work: the spacer in .stack-wrapper keeps cards clear of the header while
   they are pinned, so the stack is pulled up under the heading instead of resized. */
.hx-work .hx-head {
  position: relative;
  z-index: 2;
  margin-bottom: 0;
}
.hx-work .stack-wrapper {
  margin-top: -8rem;
}
@media only screen and (max-width: 767px) {
  .hx-work .stack-wrapper {
    margin-top: -6.6rem;
  }
}

/* ---------- Phones and small tablets: an airy hero ---------- */
@media only screen and (max-width: 991px) {
  .hx {
    padding-top: 0;
    padding-bottom: 2.4rem;
  }
  .hx .hx-wrap {
    justify-content: flex-end;
    padding-top: 9.6rem;
  }
  .hx__main {
    flex: 0 0 auto;
    padding-bottom: 0;
  }
  .hx__title {
    margin: 0;
    line-height: 1.04;
  }
  /* The landscape owns the top; the text sits on a soft fade at the bottom. */
  .hx__field::after {
    background:
      linear-gradient(to bottom, var(--hx-bg) 0%, transparent 16%, transparent 44%,
        color-mix(in srgb, var(--hx-bg) 78%, transparent) 60%, var(--hx-bg) 76%, var(--base) 100%);
  }
  .hx__foot {
    margin-top: 2.2rem;
    padding-top: 0;
    border-top: 0;
    gap: 2rem;
  }
}
@media only screen and (max-width: 767px) {
  .hx__title {
    font-size: clamp(3.6rem, 11.2vw, 5.2rem);
  }
  .hx__lead {
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--t-medium);
  }
  .hx__actions {
    flex-wrap: nowrap;
    gap: 0.8rem;
  }
  .hx__actions .hx-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 5rem;
    padding: 0 1.2rem;
    font-size: 1.5rem;
  }
  .hx__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--st-muted);
  }
  /* Numbers line up along the top even when a label wraps to two lines. */
  .hx__stats div {
    justify-content: flex-end;
  }
  .hx__stats dd {
    font-size: 2.4rem;
  }
  .hx__stats dt {
    font-size: 1.2rem;
    line-height: 1.3;
    white-space: normal;
  }
}
@media only screen and (max-width: 380px) {
  .hx__lead {
    font-size: 1.5rem;
  }
}
