/*
 * The home page's pitch, in the order of Altrd's (altrdtech.com): one ask, the numbers under
 * it, then the problem before the firm. Only what the home page adds is here; everything it
 * shares with other pages stays in site.css. Classes are prefixed hm-.
 */

/* Proof, the way Altrd sets it under its hero: a ruled row of three numbers, then a grid of
   client logos. Each logo turns over on hover (or focus, or a tap) to say who the client is,
   from the industries on the Clients page. Altrd shows each client's size there; we have no
   figures we can stand behind, so ours says what the client does instead. */
.hm-proof {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 16px auto 0;
  padding: 0 var(--gutter);
}

.hm-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 96px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hm-numbers li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 20px;
}

.hm-numbers li + li {
  border-left: 1px solid var(--line);
}

.hm-numbers svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hm-numbers b {
  font-family: var(--display);
  font-size: 30px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  line-height: 1;
}

.hm-numbers span {
  color: var(--body);
  font-size: 15px;
}

html:root .hm-proof-title {
  margin: 0 0 40px;
  font-size: clamp(26px, 2.4vw, 34px);
  text-align: center;
}

.hm-logos {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.hm-logo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  outline: none;
  cursor: default;
}

.hm-logo img {
  width: auto;
  max-width: 68%;
  height: auto;
  max-height: 30px;
  transition: opacity 0.3s var(--ease);
}

.hm-logo-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  background: var(--wash);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.hm-logo-back span {
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hm-logo-back b {
  margin: 8px 0 6px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 21px;
  font-weight: var(--display-weight);
  line-height: 1.1;
}

.hm-logo-back p {
  color: var(--body);
  font-size: 13px;
  line-height: 1.45;
}

.hm-logo:hover .hm-logo-back,
.hm-logo:focus-visible .hm-logo-back,
.hm-logo:focus .hm-logo-back {
  opacity: 1;
  transform: none;
}

.hm-logo:hover img,
.hm-logo:focus img {
  opacity: 0;
}

/* Between 960 and 1200 the six columns are too narrow for a short cell to hold the note on
   the back, so the cells go back to taller. */
@media (min-width: 961px) and (max-width: 1200px) {
  .hm-logo {
    aspect-ratio: 5 / 4;
  }

  .hm-logo-back {
    padding: 12px 14px;
  }

  .hm-logo-back b {
    font-size: 18px;
  }
}

@media (max-width: 960px) {
  .hm-logos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hm-numbers {
    margin-bottom: 64px;
  }

  .hm-numbers li {
    flex-direction: column;
    gap: 8px;
    padding: 20px 6px;
    text-align: center;
  }

  .hm-numbers b {
    font-size: 26px;
  }

  .hm-numbers span {
    font-size: 12.5px;
  }

  .hm-logo-back {
    padding: 10px;
  }

  .hm-logo-back b {
    font-size: 15px;
  }

  .hm-logo-back p {
    display: none;
  }
}

/* Why now: Altrd's band, the reader's problem before the firm. The heading across the top, then
   a photo beside three points with blue titles, then EMIAC's answer and the ask. The photo is
   a stock picture of a busy office standing in for the reader's own team, never captioned as
   ours; it is replaced once the real team photos arrive. */
.hm-why {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 144px auto 0;
  padding: 0 var(--gutter);
}

.hm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font: 12px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hm-eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand-hi);
  content: "";
}

html:root .hm-why h2 {
  max-width: 820px;
  margin: 20px 0 0;
}

.hm-why-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  margin-top: 56px;
  border-top: 1px solid var(--line);
}

/* The photo takes the height of the points beside it, so neither side leaves a gap. */
.hm-why-photo {
  position: relative;
  min-height: 420px;
  margin: 0;
  border-right: 1px solid var(--line);
}

.hm-why-photo img {
  position: absolute;
  inset: 32px 40px 32px 0;
  width: calc(100% - 40px);
  height: calc(100% - 64px);
  object-fit: cover;
  border-radius: 14px;
}

.hm-why-text {
  padding-left: 40px;
}

.hm-why-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hm-why-list li {
  border-bottom: 1px solid var(--line);
}

/* Each point is a button; the open one shows its line underneath. */
.hm-why-list button {
  display: block;
  width: 100%;
  padding: 30px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}

.hm-why-list li:not(.is-open) button {
  color: var(--ink-2);
}

.hm-why-list button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 4px;
}

.hm-why-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}

.hm-why-more > p {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.hm-why-list li.is-open .hm-why-more {
  grid-template-rows: 1fr;
}

.hm-why-list li.is-open .hm-why-more > p {
  margin-top: -14px;
  padding-bottom: 28px;
  opacity: 1;
}

.hm-why h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  line-height: 1.15;
}

.hm-why-list h3 {
  margin: 0;
  font-size: 26px;
}

.hm-why-list li.is-open button {
  color: var(--brand);
}

.hm-why p {
  max-width: 470px;
  color: var(--body);
  font-size: 17px;
  line-height: 1.55;
}

.hm-why-answer {
  padding: 40px 0 8px;
}

.hm-why-answer h3 {
  color: var(--ink);
  font-size: 32px;
}

.hm-why-answer .btn {
  margin-top: 20px;
}

@media (max-width: 860px) {
  .hm-why {
    margin-top: 80px;
  }

  .hm-why-body {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .hm-why-photo {
    min-height: 0;
    padding: 24px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hm-why-photo img {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .hm-why-text {
    padding-left: 0;
  }

  .hm-why-list button {
    padding: 24px 0;
  }

  .hm-why-list h3 {
    font-size: 23px;
  }

  .hm-why-answer h3 {
    font-size: 27px;
  }
}

/* One scale for the whole page: the hero at 64, every section heading at 44, and one gap
   between sections, so each screen holds one idea. */
html:root .hero-title {
  font-size: clamp(40px, 4.6vw, 64px);
}

html:root .big-h2,
html:root .hm-why h2,
html:root .hm-split h2,
html:root .final-band h2 {
  font-size: clamp(32px, 3.2vw, 44px);
  line-height: 1.08;
}

html:root main > .section,
html:root main > .stats,
html:root main > .news-band,
html:root main > .final-band {
  margin-top: 144px;
}

html:root .stats b {
  font-size: clamp(36px, 3.2vw, 44px);
}

/* Where it runs: a ruled strip of three, the same rule as the numbers under the hero, above
   the platform logos. */
.hm-where {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 48px 0 40px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.hm-where li {
  padding: 26px 16px;
}

.hm-where li + li {
  border-left: 1px solid var(--line);
}

.hm-where b {
  display: block;
  font-size: 18px;
  font-weight: 500;
}

.hm-where span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

/* A split with the words on the left and a list on the right, the mirror of Why now's photo
   on the left, so neighbouring splits alternate sides. */
.hm-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 144px auto 0;
  padding: 0 var(--gutter);
}

html:root .hm-split h2 {
  max-width: 460px;
  margin: 20px 0 28px;
}

.hm-checks {
  margin: 0;
  padding: 8px 32px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.hm-checks li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  font-size: 17px;
}

.hm-checks li + li {
  border-top: 1px solid var(--line);
}

.hm-checks li::before {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 12px no-repeat,
    var(--brand);
  content: "";
}

@media (max-width: 860px) {
  .hm-split {
    grid-template-columns: 1fr;
    gap: 36px;
    margin-top: 80px;
  }

  .hm-checks {
    padding: 4px 22px;
  }

  .hm-where {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hm-where li {
    padding: 18px 0;
  }

  .hm-where li + li {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  html:root main > .section,
  html:root main > .stats,
  html:root main > .news-band,
  html:root main > .final-band {
    margin-top: 80px;
  }
}

/* Home scrolls slower than other pages: things take a full second to arrive, a beat apart. */
main {
  --reveal-time: 1s;
  --step: 110ms;
}

/* How we work: a rail of three steps. On a wide screen the section is tall and its inside pins
   to the viewport; site.js moves the rail sideways as the page scrolls (.is-pinned, --p). On a
   phone, a short window or under reduced motion the steps stack and all show. */
.hm-how {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 144px auto 0;
  padding: 0 var(--gutter);
}

.hm-how.is-pinned {
  height: 300vh;
  margin-top: 64px;
}

.hm-how.is-pinned .hm-how-pin {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  padding-top: 64px;
}

.hm-how-head {
  text-align: center;
}

html:root .hm-how h2 {
  margin: 16px 0 0;
  font-size: clamp(32px, 3.2vw, 44px);
  line-height: 1.08;
}

.hm-how-bar {
  display: none;
}

.hm-how.is-pinned .hm-how-bar {
  display: block;
  width: 160px;
  height: 2px;
  margin: 28px auto 0;
  border-radius: 2px;
  background: var(--line);
}

.hm-how-bar i {
  display: block;
  width: calc(100% * var(--p, 0));
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.hm-how-view {
  margin-top: 48px;
}

.hm-how-track {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hm-how.is-pinned .hm-how-track {
  display: flex;
  gap: 28px;
  width: max-content;
  will-change: translate;
}

.hm-how-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 40px;
  padding: 44px;
  border-radius: 24px;
  background: var(--sheet);
}

.hm-how.is-pinned .hm-how-step {
  width: min(860px, 72vw);
  min-height: min(380px, 46vh);
  transition: opacity 0.5s var(--ease);
}

.hm-how.is-pinned .hm-how-step:not(.is-on) {
  opacity: 0.35;
}

.hm-how-n {
  color: var(--brand);
  font: 13px var(--mono);
}

.hm-how-copy h3 {
  margin: 14px 0 10px;
  font-family: var(--display);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  line-height: 1.1;
}

.hm-how-copy p {
  max-width: 340px;
  color: var(--body);
  font-size: 17px;
  line-height: 1.5;
}

/* The pictures beside each step: drawn from the page's own type and marks, no screenshots. */
.hm-how-art {
  display: grid;
  gap: 12px;
  padding: 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(17 17 17 / 0.05), 0 20px 40px -24px rgb(0 40 90 / 0.25);
}

.hm-art-label {
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hm-art-find span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
  border-radius: 10px;
  font-size: 14px;
  isolation: isolate;
}

.hm-art-find span::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: calc(100% * var(--w));
  border-radius: inherit;
  background: var(--wash);
  content: "";
  transform-origin: left;
  transition: scale 0.9s var(--ease);
}

.hm-how.is-pinned .hm-how-step:not(.is-on) .hm-art-find span::before {
  scale: 0.2 1;
}

.hm-art-find .is-ai::before {
  background: rgb(0 92 177 / 0.16);
}

.hm-art-find em {
  color: var(--brand);
  font: 11px var(--mono);
  font-style: normal;
}

.hm-art-tools {
  grid-template-columns: 1fr 1fr;
}

.hm-art-tools span,
.hm-art-clouds span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
}

.hm-art-tools img,
.hm-art-clouds img {
  flex: none;
  object-fit: contain;
}

.hm-art-clouds {
  display: grid;
  gap: 8px;
}

.hm-art-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 14px;
}

.hm-art-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f9d55;
  box-shadow: 0 0 0 4px rgb(31 157 85 / 0.15);
}

@media (max-width: 860px) {
  .hm-how {
    margin-top: 80px;
  }

  .hm-how-view {
    margin-top: 32px;
  }

  .hm-how-step {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 26px;
  }
}
