/*
 * Landing page, top sections: hero, relevance, development.
 *
 * Owned by the section-A task, so only .zl-hero__*, .zl-rel__* and .zl-dev__* rules belong here.
 * Colour, type and spacing come from tokens.css; the few values it does not carry are declared as
 * --zl-hero-*/--zl-rel-*/--zl-dev-* variables inside their own section selector.
 *
 */
/* ---------------------------------------------------------------------- hero */

.zl-hero {
  --zl-hero-gap: clamp(2.25rem, 5vw, 4.25rem);
  background: var(--zl-bg);
  color: var(--zl-fg);
  scroll-margin-top: var(--zl-space-2xl);
}

/* One column on a phone; text beside the photograph from 960px, vertically centred. */
.zl-hero__inner {
  display: grid;
  gap: var(--zl-hero-gap);
  align-items: center;
}

.zl-hero__text {
  min-width: 0;
}

.zl-hero .zl-hero__eyebrow {
  margin: 0 0 var(--zl-space-sm);
}

.zl-hero .zl-hero__title {
  max-width: 20ch;
  margin: 0;
  font-family: var(--zl-font-display);
  font-size: var(--zl-fs-display);
  font-weight: 400;
  line-height: var(--zl-lh-tight);
  letter-spacing: -.02em;
  text-wrap: balance;
}

.zl-hero .zl-hero__sub {
  max-width: 46ch;
  margin: var(--zl-space-md) 0 0;
}

.zl-hero .zl-hero__support {
  max-width: 46ch;
  margin: var(--zl-space-sm) 0 0;
  font-size: var(--zl-fs-small);
  color: var(--zl-ink-3);
}

.zl-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--zl-space-xs);
  margin-top: var(--zl-space-lg);
}

.zl-hero .zl-hero__micro {
  max-width: 42ch;
  margin: var(--zl-space-md) 0 0;
  font-size: var(--zl-fs-micro);
  line-height: var(--zl-lh-body);
  color: var(--zl-ink-3);
}

.zl-hero__media {
  margin: 0;
}

.zl-hero__img {
  display: block;
  width: 100%;
  height: auto;
}

/* No photograph: the section keeps a deliberately narrow measure instead of an empty frame, and the
   headline is held to a display-line length so it does not run across the whole container. */
.zl-hero .zl-hero__inner--text,
.zl-hero .zl-hero__inner--media {
  max-width: var(--zl-container-narrow);
}

.zl-hero__inner--media {
  justify-items: center;
}

.zl-hero__inner--media .zl-hero__media {
  width: 100%;
  max-width: 34rem;
}

@media (min-width: 640px) {
  .zl-hero__actions {
    flex-direction: row;
    align-items: center;
    gap: var(--zl-space-sm);
  }
}

@media (min-width: 960px) {
  .zl-hero__inner--split {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  }

  .zl-hero .zl-hero__inner--text {
    max-width: 46rem;
  }
}

/* ----------------------------------------------------------------- relevance */

.zl-rel {
  --zl-rel-lead: 32ch;
  background: var(--zl-ivory);
  color: var(--zl-fg);
  scroll-margin-top: var(--zl-space-2xl);
}

.zl-rel__inner {
  display: grid;
  gap: var(--zl-space-xl);
}

/* The statement is the section's largest line: display serif, held to a few words per line. */
.zl-rel .zl-rel__lead {
  max-width: var(--zl-rel-lead);
  font-size: var(--zl-fs-h2);
  color: var(--zl-ink);
  text-wrap: balance;
}

.zl-rel__list {
  counter-reset: zl-rel-benefit;
  display: grid;
  gap: var(--zl-space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.zl-rel__item {
  counter-increment: zl-rel-benefit;
  border-top: 1px solid var(--zl-line-strong);
  padding-top: var(--zl-space-md);
}

/* The numeral is drawn here so no number is written into the markup. */
.zl-rel__item::before {
  display: block;
  margin-bottom: var(--zl-space-xs);
  content: counter(zl-rel-benefit, decimal-leading-zero);
  font-family: var(--zl-font-body);
  font-size: var(--zl-fs-eyebrow);
  font-weight: var(--zl-weight-medium);
  letter-spacing: var(--zl-track-eyebrow);
  color: var(--zl-clay-dark);
}

.zl-rel .zl-rel__text {
  max-width: 38ch;
  margin: 0;
  font-size: var(--zl-fs-body);
  line-height: var(--zl-lh-body);
  color: var(--zl-ink-2);
}

@media (min-width: 640px) {
  .zl-rel__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--zl-space-lg);
  }
}

@media (min-width: 960px) {
  .zl-rel__inner {
    gap: clamp(2.5rem, 4vw, 4rem);
  }

  .zl-rel__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(1.75rem, 3.5vw, 3rem);
  }
}

/* --------------------------------------------------------------- development */

.zl-dev {
  --zl-dev-col: 15rem;
  --zl-dev-gap: clamp(1.75rem, 3vw, 2.75rem);
  background: var(--zl-sand-soft);
  color: var(--zl-fg);
  scroll-margin-top: var(--zl-space-2xl);
}

.zl-dev__inner {
  display: grid;
  gap: var(--zl-space-xl);
}

.zl-dev__head {
  display: grid;
  gap: var(--zl-space-md);
}

.zl-dev .zl-dev__heading {
  max-width: 22ch;
  margin: 0;
  text-wrap: balance;
}

.zl-dev .zl-dev__intro {
  max-width: 62ch;
  margin: 0;
}

/* Text rows: a thin rule above each, and columns only once there is width for them. auto-fit keeps
   two rows reading as two columns rather than leaving an empty third track. */
.zl-dev__grid {
  display: grid;
  gap: var(--zl-space-lg);
}

.zl-dev__row {
  border-top: 1px solid var(--zl-line-strong);
  padding-top: var(--zl-space-md);
}

.zl-dev .zl-dev__title {
  margin: 0;
}

.zl-dev__concern {
  margin: var(--zl-space-xs) 0 0;
  font-family: var(--zl-font-display);
  font-size: var(--zl-fs-body);
  font-style: italic;
  line-height: var(--zl-lh-body);
  color: var(--zl-ink-2);
}

.zl-dev .zl-dev__copy {
  margin: var(--zl-space-xs) 0 0;
}

.zl-dev__prompt {
  margin: var(--zl-space-sm) 0 0;
  font-size: var(--zl-fs-micro);
  line-height: var(--zl-lh-body);
  color: var(--zl-ink-3);
}

/* The row that carries a photograph: the same rule, then the image beside its text. */
.zl-dev__feature {
  display: grid;
  gap: var(--zl-space-md);
  margin: 0;
  border-top: 1px solid var(--zl-line-strong);
  padding-top: var(--zl-space-md);
}

.zl-dev__feature-media {
  margin: 0;
}

.zl-dev__img {
  display: block;
  width: 100%;
  height: auto;
}

.zl-dev__feature-text {
  min-width: 0;
}

.zl-dev .zl-dev__caption {
  margin: 0;
}

@media (min-width: 960px) {
  .zl-dev__head {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    column-gap: var(--zl-dev-gap);
    align-items: start;
  }

  .zl-dev__grid {
    grid-template-columns: repeat(auto-fit, minmax(var(--zl-dev-col), 1fr));
    column-gap: var(--zl-dev-gap);
  }

  .zl-dev__feature {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    column-gap: var(--zl-dev-gap);
    align-items: center;
    margin-top: var(--zl-space-sm);
  }

  /* A row whose photograph has no text beside it takes the full width rather than half of it. */
  .zl-dev__feature--lone {
    grid-template-columns: minmax(0, 1fr);
  }

  .zl-dev__feature-media {
    grid-area: 1 / 1;
  }

  .zl-dev__feature-text {
    grid-area: 1 / 2;
  }

  /* The caption spans under the whole block, so it never floats free of a shorter image. */
  .zl-dev__caption {
    grid-area: 2 / 1 / 3 / -1;
  }
}
