/*
 * Home page. Loaded only on /, alongside /styles/site.css, which supplies the
 * tokens, the fonts, the bands, the type classes, the links and the buttons.
 * The page loads no theme CSS, so the base rules here are the whole of its
 * typography.
 *
 * Calm rules (review/DESIGN-SPEC.md):
 *   - Eight text styles and no more: h1 (.dz-display), h2 (.dz-h2), h3
 *     (.dz-h3), body 16px, small 14px Steel (.hm-small), the 12px uppercase
 *     label (table column heads and the hero eyebrow only), bold 16px for
 *     links, buttons and row heads, and monospace for the saving figure.
 *   - White bands; the proof is the one snow band and Print My Part the one
 *     Ink band. Orange is the h1 accent, one word in the Print My Part
 *     heading and the focus ring.
 *   - Two spacing values: --hm-band between bands, --hm-gap between a
 *     heading and its content.
 *   - Left-aligned, except the hero and the closing call to action.
 *   - No boxes: tiles and cards have no border, background or shadow.
 *
 * Mobile first: the base rules are the 320px layout and the media queries add
 * columns as the screen widens.
 */

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--dz-head-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body.dz-home {
  margin: 0;
  background: var(--dz-white);
  color: var(--dz-ink);
  font-family: var(--dz-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hm {
  --hm-band: clamp(44px, 5.5vw, 76px);
  --hm-gap: clamp(28px, 3.2vw, 44px);
}
.hm *,
.hm *::before,
.hm *::after {
  box-sizing: border-box;
}
:where(.hm) :is(h1, h2, h3, p, ul, ol, figure) {
  margin: 0;
  padding: 0;
}
:where(.hm) :is(ul, ol) {
  list-style: none;
}
:where(.hm) img {
  display: block;
  max-width: 100%;
  height: auto;
}
.hm :focus-visible {
  outline: 2px solid var(--dz-ink);
  outline-offset: 2px;
}
.hm :is(.dz-band--ink) :focus-visible {
  outline-color: var(--dz-brand);
}

/* Inline links: Ink, regular weight, a thin underline that goes solid on hover. */
.hm p a:not(.dz-btn) {
  color: var(--dz-ink);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.hm p a:not(.dz-btn):hover {
  text-decoration-color: currentColor;
}

/* ---------- Rhythm ---------- */

/* site.css loads after this file, so a rule here that overrides a shared
   .dz-* class needs one more class than the rule it overrides. */
.hm .dz-band {
  padding: var(--hm-band) 0;
}
.hm-head {
  display: grid;
  gap: 16px;
  margin-bottom: var(--hm-gap);
}
.hm-head .dz-h2 {
  max-width: 20ch;
}

/* ---------- Text styles ---------- */

.hm-sub {
  max-width: 58ch;
  color: var(--dz-steel);
  text-wrap: pretty;
}
.hm-small {
  font-size: 14px;
  line-height: 1.5;
  color: var(--dz-steel);
}
.dz-band--ink .hm-sub,
.dz-band--ink .hm-small {
  color: var(--dz-steel-on-ink);
}
.hm-terms {
  margin-top: 16px;
}
.hm-after-link {
  margin-top: var(--hm-gap);
}

/* ---------- Centred bands: the hero and the closing call to action ---------- */

.hm-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hm .dz-band.hm-hero {
  padding-bottom: 0;
  overflow: hidden;
}
.hm-hero .dz-display {
  max-width: 13ch;
  margin-top: 16px;
}
.hm-hero .hm-sub {
  max-width: 46ch;
  margin-top: 24px;
}
.hm-hero .dz-btn {
  margin-top: 28px;
}
.hm-hero .dz-link {
  margin-top: 8px;
}
.hm-hero-img {
  width: min(86vw, 520px);
  margin-top: 16px;
}
.hm-close .dz-h2 {
  max-width: 18ch;
}
.hm-close .dz-btn {
  margin-top: var(--hm-gap);
}

/* ---------- Four facts ---------- */

.hm-stats-band .dz-wrap {
  padding-top: 0;
  padding-bottom: 0;
}
.hm-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 24px;
  padding: 28px 0;
  border-top: 1px solid var(--dz-line-strong);
  border-bottom: 1px solid var(--dz-line-strong);
}
.hm-stats li {
  display: grid;
  align-content: start;
  gap: 6px;
}
@media (min-width: 900px) {
  .hm-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    padding: 36px 0;
  }
}

/* ---------- Pick by the job ---------- */

.hm-apps {
  display: grid;
  gap: 40px 24px;
}
.hm-app {
  display: flex;
  flex-direction: column;
}
.hm-app > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--dz-radius-md);
}
.hm-app .dz-h3 {
  margin-top: 20px;
}
.hm-app .hm-small {
  margin-top: 8px;
}
/* The machine links sit on one line at the foot of every tile in the row. */
.hm-app .hm-fit {
  margin-top: auto;
  padding-top: 4px;
}
.hm-fit a {
  display: inline-block;
  padding: 12px 0;
}
@media (min-width: 640px) {
  .hm-apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .hm-apps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- The range: machine photos sit on the band, uncropped ---------- */

.hm-range {
  display: grid;
  gap: 48px 32px;
}
.hm-machine {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--dz-ink);
  text-decoration: none;
}
.hm-machine .dz-scale {
  max-width: 320px;
}
.hm-machine img {
  transition: transform var(--dz-base) var(--dz-ease);
}
.hm-machine .dz-h3 {
  margin-top: 20px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.hm-machine:hover .dz-h3 {
  text-decoration-color: currentColor;
}
.hm-machine:hover img {
  transform: translateY(-3px);
}
.hm-machine .hm-small {
  margin-top: 8px;
}
.hm-machine .hm-small + .hm-small {
  margin-top: 2px;
}
@media (min-width: 640px) {
  .hm-range {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .hm-range {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 64px 48px;
  }
}

/* ---------- Proof: before-and-after bars ---------- */
/* One card per customer part. The saving is the thing to look at; under it,
   a pair of bars for cost and a pair for time. "Before" is a quiet grey bar at
   full width, "after" is Molten and drawn to scale against it. Every bar has
   its figure written beside it, so nothing is read from colour or length alone. */

.hm-cases {
  display: grid;
  gap: 48px;
}
.hm-case {
  padding-top: 24px;
  border-top: 1px solid var(--dz-line-strong);
}
.hm-case-fig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 16px;
}
.hm-case .dz-h3 + .hm-small {
  margin-top: 4px;
}
.hm-bars {
  display: grid;
  gap: 6px;
  margin-top: 20px;
}
.hm-bar-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.hm-bar-row dd {
  --hm-bar-label: 96px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.hm-bar {
  /* To scale: every bar is a share of the same track, which is the row less
     the room kept for the longest figure. */
  flex: none;
  width: calc((100% - var(--hm-bar-label)) * var(--w) / 100);
  min-width: 4px;
  height: 10px;
  border-radius: 0 var(--dz-radius) var(--dz-radius) 0;
}
.hm-bar--before {
  background: var(--dz-steel-light);
}
.hm-bar--after {
  background: var(--dz-brand);
}
.hm-bar-row .dz-mono {
  flex: none;
  font-size: 14px;
  white-space: nowrap;
}
@media (min-width: 860px) {
  .hm-cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px 72px;
  }
}


/* ---------- Print My Part: three steps on Ink ---------- */

.hm-steps,
.hm-after {
  display: grid;
  gap: 28px 32px;
}
.hm-steps {
  margin-bottom: var(--hm-gap);
}
.hm-steps .dz-h3 span {
  margin-right: 6px;
  color: var(--dz-faint-on-ink);
}
.hm-steps .hm-sub,
.hm-after .hm-sub {
  max-width: 40ch;
  margin-top: 8px;
}
@media (min-width: 860px) {
  .hm-steps,
  .hm-after {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Before you buy: after the order, then the questions ---------- */

.hm-faq {
  max-width: 860px;
  margin-top: var(--hm-gap);
  border-top: 1px solid var(--dz-line-strong);
}
.hm-faq details {
  border-bottom: 1px solid var(--dz-line-strong);
}
.hm-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}
.hm-faq summary::-webkit-details-marker {
  display: none;
}
.hm-faq summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-right: 2px solid var(--dz-steel);
  border-bottom: 2px solid var(--dz-steel);
  transform: translateY(-3px) rotate(45deg);
  transition: transform var(--dz-fast) var(--dz-ease);
}
.hm-faq details[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}
.hm-faq summary h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.hm-faq details .hm-sub {
  max-width: 68ch;
  padding: 0 0 24px;
}

/* ---------- Awards: one quiet row, no band of its own ---------- */

.hm-awards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  padding: 28px 0;
  border-top: 1px solid var(--dz-line-strong);
  border-bottom: 1px solid var(--dz-line-strong);
}
.hm-awards li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hm-awards img {
  flex: none;
  width: 56px;
}
@media (min-width: 900px) {
  .hm-awards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm *,
  .hm *::before,
  .hm *::after {
    transition: none !important;
  }
  .hm-machine:hover img {
    transform: none;
  }
}

/* ---------- Additions from the buyer brief (review/icp/00-ICP-BRIEF.md) ---------- */

/* The reply-time line under the hero button. */
.hm-hero .hm-small {
  margin-top: 12px;
}
/* Build size, drawn to scale against the largest machine in the range. */
.hm-size {
  display: block;
  width: calc(var(--w) * 1%);
  min-width: 8px;
  height: 6px;
  margin: 14px 0 8px;
  border-radius: 0 var(--dz-radius) var(--dz-radius) 0;
  background: var(--dz-steel-light);
}
.hm-terms a,
.hm-purchase a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.hm-purchase {
  max-width: 72ch;
  margin-top: var(--hm-gap);
  padding-top: 24px;
  border-top: 1px solid var(--dz-line-strong);
}
@media (min-width: 860px) {
  .hm-after--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Watch it print: text left, the vertical clip right ---------- */
.hm-watch {
  display: grid;
  gap: 32px;
  align-items: center;
}
.hm-watch .dz-video {
  justify-self: center;
  width: 100%;
}
@media (min-width: 860px) {
  .hm-watch {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 64px;
  }
}
