/*
 * Folio, the hero layer: the headline, the standfirst, the reassurances and
 * the call; the hub's headline grid, and the copy column beside a form on the
 * lead and order pages. Needs styles.css.
 */

.hero {
  padding-block: 36px 44px;
}

.hero-grid {
  display: grid;
  gap: 40px;
}

/* Kicker: the section name, set like a newspaper's section flag. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--gold-deep);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--gold-rule);
  transform: rotate(45deg);
}

/* Serif measures in em, not ch: 1ch is the width of "0", which differs
   between the web font and its fallback, so a ch width would change when
   the fonts swap in. Each value is the old ch width in Frank Ruhl Libre
   ("0" = 0.563em). */
.hero h1 {
  font-weight: 400;
  font-size: clamp(2.125rem, 1.35rem + 3.6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  max-width: 10.13em; /* 18ch */
}

.hero-grid h1 {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  max-width: 11.26em; /* 20ch */
}

/* The part before the colon carries the weight; the rest is set lighter. */
.h1-kicker {
  display: block;
  font-weight: 700;
}

.hero .lead {
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  line-height: 1.6;
  color: #36322b;
  max-width: 29.28em; /* 52ch */
}

/* Hero lists: ruled lines, no check marks. */
.checks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  max-width: 52ch;
  border-top: 1px solid var(--rule);
}

.checks li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding-block: 10px;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}

.checks li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 1px;
  background: var(--gold-rule);
  transform: translateY(-0.3em);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin-top: 28px;
}

/* ---------- What happens next, beside the order form --------------------- */
.hero-steps {
  margin-top: 40px;
}

.hero-steps h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  line-height: 1.2;
  padding-top: 12px;
  border-top: 2px solid var(--rule-ink);
}

.hero-steps .steps {
  margin-top: 4px;
  max-width: 52ch;
}

/* ---------- Phones: the contact bar is the one call action ---------------- */
@media (max-width: 859px) {
  .hero .actions {
    display: none;
  }
}

/* Phones and tablets: the sheet follows the headline and the standfirst,
   so the form starts on the first screen; the reassurances and the call
   (also in the contact bar) follow it. */
@media (max-width: 1023px) {
  .hero-grid {
    gap: 0;
  }
  .hero-grid > div:first-child {
    display: contents;
  }
  .hero-grid .eyebrow {
    order: 1;
    justify-self: start;
  }
  .hero-grid h1 {
    order: 2;
  }
  .hero-grid .lead {
    order: 3;
  }
  .hero-grid > form {
    order: 4;
    margin-top: 28px;
  }
  .hero-grid .checks {
    order: 5;
    margin-top: 36px;
  }
  .hero-grid .actions {
    order: 6;
  }
  .hero-grid .hero-steps {
    order: 7;
    margin-top: 48px;
  }
}

/* Where the hero call buttons still show (860-1023px), keep them where the
   markup has them, before the form, so focus order follows the screen. */
@media (min-width: 860px) and (max-width: 1023px) {
  .hero-grid .actions {
    order: 3;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-block: 64px 72px;
  }
  .hero:has(.hero-index) {
    padding-block: 72px 64px;
  }

  /* Hub: the headline holds eight columns; the standfirst and the call sit
     in the remaining four, behind a column rule. */
  .hero-index {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    grid-template-rows: auto 1fr auto;
    column-gap: 56px;
  }
  .hero-index .eyebrow {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .hero-index h1 {
    grid-column: 1;
    grid-row: 2 / span 2;
    max-width: none;
  }
  .hero-index .lead,
  .hero-index .actions {
    grid-column: 2;
    margin: 0;
    padding-inline-start: 32px;
    border-inline-start: 1px solid var(--rule);
  }
  .hero-index .lead {
    grid-row: 2;
    align-self: stretch;
    display: flex;
    align-items: flex-end;
    padding-top: 12px;
  }
  .hero-index .actions {
    grid-row: 3;
    padding-top: 24px;
    padding-bottom: 10px;
  }

  /* Order and lead pages: copy on seven columns, the sheet on five. */
  .hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
    column-gap: 72px;
  }
  .hero-grid > div:first-child {
    padding-top: 8px;
  }
  .hero-steps {
    margin-top: 56px;
  }
}

/* The copy column stays beside the long form instead of ending early. On the
   order page the column runs the form's height and the process sticks in it;
   elsewhere the whole pitch sticks. Only where it fits in the window. */
@media (min-width: 1024px) and (min-height: 760px) {
  .hero-grid > div:first-child:not(:has(.hero-steps)) {
    position: sticky;
    top: 32px;
  }
  .hero-grid > div:first-child:has(.hero-steps) {
    align-self: stretch;
  }
  .hero-steps {
    position: sticky;
    top: 32px;
  }
}

/* ---------- One restrained moment: the headline sets ----------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero .lead,
  .hero .checks,
  .hero .actions {
    transition:
      opacity 700ms var(--ease-out),
      transform 700ms var(--ease-out);
  }
  .hero .lead,
  .hero .checks {
    transition-delay: 80ms;
  }
  .hero .actions {
    transition-delay: 140ms;
  }
  @starting-style {
    .hero h1,
    .hero .lead,
    .hero .checks,
    .hero .actions {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero .lead {
    transition: opacity 400ms ease;
  }
  @starting-style {
    .hero h1,
    .hero .lead {
      opacity: 0;
    }
  }
}
