/* ==========================================================================
   ProntaMano — home page (apps/pages/templates/pages/home.html)

   1. Hero & trust row
   2. Section anchors (smooth scrolling)
   3. Service infographics
      3a. Journey panel (+ phone disclosure)   3b. Flow (numbered process)
      3c. Route band   3d. Outcomes (clearance)   3e. Tiles (assembly / other)   3f. Notice
   4. Scroll reveal (progressive enhancement, see js/home.js)

   All classes are prefixed `pm-home-` so they never clash with shared
   components in static/css/main.css. Colours come from the design tokens.
   ========================================================================== */

/* 1. Hero & trust row ------------------------------------------------------- */
.pm-home-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 88% 12%, rgba(var(--pm-accent-rgb), 0.16), transparent 38%),
    linear-gradient(160deg, var(--pm-primary-soft) 0%, var(--pm-surface) 55%, var(--pm-white) 100%);
}
.pm-home-hero h1 {
  font-size: clamp(2.1rem, 1.35rem + 2.6vw, 3.4rem);
  max-width: 20ch;
}

.pm-home-hero__art { position: relative; }
/* Soft organic blob behind the illustration. */
.pm-home-hero__art::before {
  content: "";
  position: absolute;
  inset: 6% 2% 2% 6%;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  background: var(--pm-white);
  opacity: 0.7;
}
.pm-home-hero__art img { position: relative; }

.pm-home-trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
}
.pm-home-trust__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}
.pm-home-trust__icon {
  flex: 0 0 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pm-white);
  color: var(--pm-primary);
  box-shadow: var(--pm-shadow-sm);
}
@media (max-width: 399.98px) {
  .pm-home-trust { grid-template-columns: 1fr; }
}

/* 2. Section anchors --------------------------------------------------------- */
/* Links to a section (/#services) scroll smoothly; main.css keeps every target
   with an id clear of the sticky navbar. */
@media (prefers-reduced-motion: no-preference) {
  html:has(.pm-page-home) { scroll-behavior: smooth; }
}

/* Phones: the service cards do not repeat the sub-services — the infographics
   right below list them (keeps the quote form within reach). */
@media (max-width: 767.98px) {
  .pm-page-home .pm-service-card .pm-checklist { display: none; }
}

/* 3a. Journey panel (one per service) ------------------------------------------ */
.pm-home-journey {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: calc(var(--pm-radius) * 1.5);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}
.pm-home-journey + .pm-home-journey { margin-top: 2rem; }
.pm-home-journey__art {
  display: block;
  width: 100%;
  max-width: 16rem;
  height: auto;
  margin-inline: auto;
}
/* Inline (not flex): on a wrapped two-line label the arrow stays right after the text. */
.pm-home-journey__more {
  font-weight: 600;
  text-decoration: none;
}
.pm-home-journey__more .bi { margin-left: 0.2rem; vertical-align: -0.125em; }
.pm-home-journey__more:hover,
.pm-home-journey__more:focus-visible { text-decoration: underline; }

/* Phones and tablets: the infographic is a disclosure (<details>) that
   js/home.js closes below 992px; on desktop it is always open and the toggle
   is hidden. */
.pm-home-journey__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  color: var(--pm-primary-dark);
  background: var(--pm-white);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  cursor: pointer;
  list-style: none;
}
.pm-home-journey__toggle::-webkit-details-marker { display: none; }
.pm-home-journey__toggle:hover { border-color: var(--pm-primary-light); }
.pm-home-journey__chevron {
  flex-shrink: 0;
  transition: transform var(--pm-transition);
}
.pm-home-journey__details[open] > .pm-home-journey__toggle .pm-home-journey__chevron { transform: rotate(180deg); }
.pm-home-journey__details:not([open]) > .pm-home-journey__toggle { margin-bottom: 0; }
@media (min-width: 992px) {
  .pm-home-journey__toggle { display: none; }
}

/* One quote button per service, below its infographic. */
.pm-home-journey__cta {
  margin: 1.5rem 0 0;
  text-align: center;
}

/* Small uppercase caption above tiles / outcomes. */
.pm-home-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pm-muted);
  margin-bottom: 0.9rem;
}

/* 3b. Flow: numbered steps joined by dashed connectors ----------------------------
   Mobile: vertical list (marker on the left, line going down).
   Desktop: one row, the line runs from each marker to the next one.        */
.pm-home-flow {
  --pm-flow-marker: 3rem;
  --pm-flow-gap: 1.5rem;
  --pm-flow-line: var(--pm-primary-light);
  display: grid;
  gap: var(--pm-flow-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pm-home-flow--compact { max-width: 58rem; margin-inline: auto; }

.pm-home-flow__step {
  position: relative;
  display: grid;
  grid-template-columns: var(--pm-flow-marker) minmax(0, 1fr);
  column-gap: 1rem;
  align-items: start;
}
/* Connector line … */
.pm-home-flow__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--pm-flow-marker) / 2 - 1px);
  top: calc(var(--pm-flow-marker) + 0.4rem);
  bottom: calc(-1 * var(--pm-flow-gap) + 0.4rem);
  border-left: 2px dashed var(--pm-flow-line);
}
/* … and its arrow head (a rotated corner). */
.pm-home-flow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--pm-flow-marker) / 2 - 5px);
  bottom: calc(-1 * var(--pm-flow-gap) + 0.35rem);
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--pm-flow-line);
  border-bottom: 2px solid var(--pm-flow-line);
  transform: rotate(45deg);
}

.pm-home-flow__marker {
  position: relative;
  z-index: 1;
  width: var(--pm-flow-marker);
  height: var(--pm-flow-marker);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pm-primary);
  color: var(--pm-white);
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 0 0 6px var(--pm-surface), var(--pm-shadow-sm);
}
.pm-home-flow__step--optional .pm-home-flow__marker {
  background: var(--pm-accent);
  color: var(--pm-ink);
}

.pm-home-flow__card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  height: 100%;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  background: var(--pm-white);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow-sm);
  transition: transform var(--pm-transition), box-shadow var(--pm-transition), border-color var(--pm-transition);
}
.pm-home-flow__card:hover,
.pm-home-flow__card:focus-visible {
  color: inherit;
  transform: translateY(-3px);
  border-color: var(--pm-primary-light);
  box-shadow: var(--pm-shadow);
}
.pm-home-flow__step--optional .pm-home-flow__card {
  border-style: dashed;
  border-color: var(--pm-accent);
  background: linear-gradient(180deg, var(--pm-white), var(--pm-accent-soft));
}
.pm-home-flow__art {
  flex: 0 0 4rem;
  width: 4rem;
  height: 4rem;
}
.pm-home-flow__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.pm-home-flow__title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.pm-home-flow__text {
  color: var(--pm-muted);
  font-size: 0.925rem;
}
.pm-home-flow__badge {
  align-self: flex-start;
  color: var(--pm-ink);
  background: var(--pm-accent-soft);
  border: 1px solid var(--pm-accent);
  font-weight: 600;
}

/* Phones: smaller marker, illustration above the text so the text gets the full width. */
@media (max-width: 575.98px) {
  .pm-home-flow { --pm-flow-marker: 2.5rem; }
  .pm-home-flow__step { column-gap: 0.75rem; }
  .pm-home-flow__card { flex-direction: column; gap: 0.5rem; }
  .pm-home-flow__art { flex: none; width: 3.5rem; height: 3.5rem; }
}

@media (min-width: 992px) {
  .pm-home-flow {
    --pm-flow-gap: 2rem;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .pm-home-flow__step {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    row-gap: 1rem;
    align-items: stretch;
    justify-items: start;
  }
  .pm-home-flow__card { width: 100%; }
  .pm-home-flow__step:not(:last-child)::before {
    top: calc(var(--pm-flow-marker) / 2 - 1px);
    bottom: auto;
    left: calc(var(--pm-flow-marker) + 0.5rem);
    right: calc(-1 * var(--pm-flow-gap) + 0.6rem);
    border-left: 0;
    border-top: 2px dashed var(--pm-flow-line);
  }
  .pm-home-flow__step:not(:last-child)::after {
    top: calc(var(--pm-flow-marker) / 2 - 5px);
    bottom: auto;
    left: auto;
    right: calc(-1 * var(--pm-flow-gap) + 0.55rem);
    transform: rotate(-45deg);
  }
  .pm-home-flow__card {
    flex-direction: column;
    align-items: flex-start;
  }
  .pm-home-flow__art {
    flex: none;
    align-self: center;
    width: 100%;
    max-width: 9rem;
    height: auto;
  }
}

/* 3c. Route band (moving): current home ─ ─ 🚚 ─ ─ new home -------------------- */
.pm-home-route {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--pm-white);
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}
.pm-home-route__stop {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  color: var(--pm-primary-dark);
}
.pm-home-route__stop .bi { font-size: 1.4rem; }
.pm-home-route__road {
  position: relative;
  flex: 1;
  border-top: 2px dashed var(--pm-primary-light);
}
.pm-home-route__van {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pm-accent);
  color: var(--pm-ink);
  font-size: 1.15rem;
  transform: translate(-50%, -52%);
}
@media (max-width: 575.98px) {
  .pm-home-route__stop span { display: none; }
}

/* 3d. Outcomes (clearance): the flow branches into two destinations ------------- */
.pm-home-outcomes { margin-top: 2rem; }
.pm-home-outcomes__list {
  display: grid;
  gap: 1rem;
  padding: 0;
}
.pm-home-outcome {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--pm-white);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow-sm);
}
@media (min-width: 768px) {
  .pm-home-outcomes__list {
    position: relative;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 2rem;
  }
  /* Trunk + horizontal branch joining the centres of both cards (gap = 1rem). */
  .pm-home-outcomes__list::before {
    content: "";
    position: absolute;
    top: 1rem;
    left: calc(25% - 0.25rem);
    right: calc(25% - 0.25rem);
    border-top: 2px dashed var(--pm-primary-light);
  }
  .pm-home-outcomes__list::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(50% - 1px);
    height: 1rem;
    border-left: 2px dashed var(--pm-primary-light);
  }
  .pm-home-outcome::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: calc(50% - 1px);
    height: 1rem;
    border-left: 2px dashed var(--pm-primary-light);
  }
}

/* 3e. Tiles (assembly and any other kind) ------------------------------------------ */
.pm-home-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) {
  .pm-home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .pm-home-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.pm-home-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  padding: 1.25rem 1rem;
  text-align: center;
  color: inherit;
  text-decoration: none;
  background: var(--pm-white);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow-sm);
  transition: transform var(--pm-transition), box-shadow var(--pm-transition), border-color var(--pm-transition);
}
.pm-home-tile:hover,
.pm-home-tile:focus-visible {
  color: inherit;
  transform: translateY(-3px);
  border-color: var(--pm-primary-light);
  box-shadow: var(--pm-shadow);
}
.pm-home-tile__art {
  width: 6.5rem;
  height: 6.5rem;
  margin-bottom: 0.4rem;
}
.pm-home-tile__title { font-weight: 700; line-height: 1.3; }
.pm-home-tile__text {
  color: var(--pm-muted);
  font-size: 0.875rem;
}
@media (max-width: 575.98px) {
  .pm-home-tile__art { width: 5rem; height: 5rem; }
  .pm-home-tile__text { display: none; }
}

/* 3f. Notice ("honest about our limits") ----------------------------------------- */
.pm-home-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--pm-accent-soft);
  border-left: 4px solid var(--pm-accent);
  border-radius: var(--pm-radius-sm);
}
.pm-home-notice__icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 1.25rem;
  color: var(--pm-accent-dark);
}

/* 4. Scroll reveal ----------------------------------------------------------------------
   js/home.js adds `pm-reveal-ready` to <html> only when IntersectionObserver is
   available and the visitor has not asked for reduced motion. Without JS all
   content is simply visible. */
.pm-reveal-ready .pm-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.pm-reveal-ready .pm-reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* The van drives in once its panel becomes visible. */
.pm-reveal-ready .is-visible .pm-home-route__van { animation: pm-home-drive 1.8s ease-out both; }
@keyframes pm-home-drive {
  from { left: 8%; }
  to { left: 50%; }
}
