/* How it works: this page's own layout only. Colour, type, cards, the phone (.ph), the stage backdrop
   (.stagebox) and the scene come from ../../design-system/ and agents.css. Loaded after agents.css. */

/* ============================================================
   Page header: the four parts of the page, on the wash
   ============================================================ */
.hiw-parts {
  max-width: 64rem;
  margin: var(--space-10) auto 0;
}
.hiw-parts ol {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}
@media (min-width: 40rem) {
  .hiw-parts ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }
}
.hiw-parts a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 100%;
  min-height: var(--tap);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--card-radius-sm);
  background: color-mix(in srgb, var(--card-float) 72%, transparent);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--dur-base) var(--ease-out);
}
.hiw-parts a:hover {
  background: var(--card-float);
}
.hiw-parts__text {
  display: grid;
  line-height: 1.3;
}
.hiw-parts__text strong {
  font-weight: var(--weight-semibold);
}
.hiw-parts__text span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
@media (min-width: 60rem) {
  .hiw-parts ol {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Each part has one icon tile, the same in its link at the top and in its eyebrow */

/* ============================================================
   Part 1: set up once. Copy and steps on the left, the crew photo on the right.
   ============================================================ */
.hiw-setup__grid {
  row-gap: var(--space-8);
  align-items: start;
}
.hiw-setup__head {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}
.hiw-steps {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
}
.hiw-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-5);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.hiw-step__body {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}
.hiw-step__body .setup__step {
  margin: 0;
}
.hiw-step__body p:not(.setup__step) {
  max-width: var(--measure);
  color: var(--color-text-muted);
}
.hiw-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  margin: var(--space-2) 0 0;
  padding: 0;
}
.hiw-logos .am-brandmark {
  height: 1.25rem;
}
@media (min-width: 60rem) {
  .hiw-setup__head,
  .hiw-steps {
    grid-column: 1 / span 6;
  }
  .hiw-setup__media {
    grid-column: 8 / -1;
    grid-row: 1 / span 2;
    position: sticky;
    top: 6rem;
  }
  /* The card sits low on the crew photo, under the faces */
  .hiw-setup__media .hiw-photo {
    padding-bottom: var(--space-16);
  }
}

/* ============================================================
   A photo with one floating product card over a corner (never over a face).
   On a phone the card sits under the photo, overlapping its lower edge.
   ============================================================ */
.hiw-photo {
  position: relative;
}
.hiw-photo--top img {
  object-position: 50% 30%;
}
/* Drawn at 320px; on a phone at 280px, so the card's text stays readable at its smaller size */
.hiw-card {
  --design: 280;
  width: min(21rem, 100%);
}
.hiw-photo .hiw-card {
  position: relative;
  width: min(20rem, 92%);
  margin: calc(var(--space-12) * -1) var(--space-2) 0 auto;
}
@media (min-width: 60rem) {
  .hiw-card {
    --design: 320;
  }
  .hiw-photo {
    padding-bottom: var(--space-8);
  }
  .hiw-photo .hiw-card {
    position: absolute;
    right: calc(var(--space-6) * -1);
    bottom: 0;
    width: min(20rem, 62%);
    margin: 0;
  }
}
.hiw-card .am-card {
  gap: var(--space-3);
}
.hiw-card .notif__head {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 6);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.hiw-card .opts,
.hiw-card .acts {
  margin-top: 0;
}
.hiw-card .draft {
  margin-top: 0;
}
.hiw-card .flag {
  margin: 0;
}
.hiw-ok .am-rows li {
  padding-block: var(--space-2);
}
.hiw-ok .mini__head span {
  font-size: var(--text-xs);
}
/* Where a document went: a mark or a tick, then one line */
.hiw-sync {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.hiw-sync .am-icon {
  color: var(--color-success);
}

/* ============================================================
   Part 2: the agents work. The head reuses the home page's agent__head.
   ============================================================ */
.hiw-flow {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}
.hiw-flow li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--color-text-muted);
}
.hiw-flow strong {
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}
.hiw-flow > li > span:last-child {
  padding-top: 0.2rem;
}
.hiw-work__foot {
  display: grid;
  gap: var(--space-3);
}
.hiw-work__more {
  max-width: var(--measure);
}

/* ============================================================
   Part 3: you approve. Copy on the left, a still phone on the front desk tint.
   ============================================================ */
.hiw-approve__grid {
  row-gap: var(--space-10);
  align-items: center;
}
.hiw-approve__copy {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}
.hiw-replies {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
}
.hiw-replies li {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.hiw-replies p {
  color: var(--color-text-muted);
}
.hiw-key {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-semibold);
}
.hiw-key b {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--color-fill);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.hiw-key b .am-icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.25;
}
.hiw-rule {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.012em;
  line-height: 1.4;
}
.hiw-rule .am-icon {
  margin-top: 0.1em;
}
.hiw-approve__stage {
  display: grid;
  place-items: center;
  padding-block: clamp(2rem, 1rem + 4vw, 4rem);
}
.hiw-phone {
  --design: 268;
  width: min(100%, 18.5rem);
}
/* A still chat shows its latest messages, as a real one does, fading at the top like a scrolled thread */
.hiw-phone .ph__body {
  justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--u) * 26));
  mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--u) * 26));
}
.hiw-phone .opts {
  margin-top: calc(var(--u) * 6);
}
@media (min-width: 40rem) {
  .hiw-replies li {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: var(--space-5);
    align-items: center;
  }
}
@media (min-width: 60rem) {
  .hiw-approve__copy {
    grid-column: 1 / span 6;
  }
  .hiw-approve__stage {
    grid-column: 8 / -1;
  }
}

/* ============================================================
   Part 4: a day at Brightside Cleaning. A time rail on the left; each stop has its words and a photo or a
   still card on its agent's tint.
   ============================================================ */
.hiw-day__head {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  max-width: 52rem;
  margin-bottom: var(--space-head);
}
.day {
  --rail-x: 0.5rem;
  position: relative;
  display: grid;
  gap: var(--space-12);
  margin: 0;
  padding: 0;
}
.day::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: calc(var(--rail-x) - 1px);
  width: 2px;
  background: var(--color-border);
}
.day__item {
  position: relative;
  display: grid;
  gap: var(--space-5);
  padding-left: 2.25rem;
}
.day__item::before {
  content: '';
  position: absolute;
  top: 0.3rem;
  left: calc(var(--rail-x) - 0.5rem);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow: inset 0 0 0 2px var(--color-text);
}
.day__when {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.day__text {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  align-content: start;
}
.day__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-snug);
  text-wrap: balance;
}
.day__text > p:not(.am-eyebrow, .day__line) {
  max-width: 34rem;
  color: var(--color-text-muted);
  text-wrap: pretty;
}
.day__line {
  margin-top: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.012em;
}
.day__panel {
  display: grid;
  place-items: center;
}
.day__panel .hiw-card {
  width: min(22rem, 100%);
}
.day__foot {
  margin-top: var(--space-8);
  padding-left: 2.25rem;
}
/* The last stop: a filled dot, the day is done */
.day__item--end::before {
  background: var(--color-text);
}
.day__item--end .am-tile--plain {
  --tile-bg: var(--color-fill);
}
@media (min-width: 60rem) {
  .day {
    --rail-x: 8.75rem;
    gap: var(--space-16);
  }
  .day__item {
    grid-template-columns: 7rem minmax(0, 5fr) minmax(0, 6fr);
    column-gap: 3.5rem;
    align-items: start;
    padding-left: 0;
  }
  .day__when {
    padding-top: 0.15rem;
    text-align: right;
  }
  .day__panel {
    aspect-ratio: 16 / 11;
  }
  .day__media {
    margin-right: var(--space-6);
  }
  .day__foot {
    padding-left: 10.5rem;
  }
}

/* ============================================================
   Closing: the goal line is longer than the home page's closing line
   ============================================================ */
.hiw-closing .closing__panel .am-display {
  max-width: 22ch;
}
