/* Home: intro, the catalogue rows (app icon, name, facts), support. Tokens come from site.css.
   A row takes its colour from a .hue-* class; nothing here names a product colour directly. */

main {
  /* A wide row ends with the facts column and a gutter for the chevron. The intro's lead and the
     support list start on the facts' text line (--side-w from the right edge), so the page has one
     right-hand axis. */
  --facts-w: 344px;
  --facts-pad: 32px;
  --row-end: 64px;
  --side-w: calc(var(--facts-w) - var(--facts-pad) + var(--row-end));
}

.intro { padding-top: clamp(56px, 9vw, 128px); padding-bottom: clamp(48px, 7vw, 96px); }
.intro h1 { font-size: var(--t-3xl); line-height: 1; letter-spacing: -0.035em; font-weight: 700; max-width: 18ch; }
.intro p { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); max-width: 54ch; margin: 1.6rem 0 0; }
/* Wide: the headline on the left in three lines, the lead in the right-hand column, standing on the
   headline's last baseline. */
@media (min-width: 1040px) {
  .intro { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); column-gap: 48px; align-items: end; align-items: last baseline; }
  .intro h1 { max-width: none; }
  .intro p { font-size: 1.1rem; max-width: none; margin: 0; }
}

/* ---------- Catalogue: one .shelf per category (h2 + .rows); categories stack with the same rhythm ---------- */
#products, #support, .shelf { scroll-margin-top: 24px; }
.shelf + .shelf { margin-top: clamp(40px, 5vw, 64px); }
.shelf h2 { font-size: var(--t-xl); margin: 0 0 16px; }

/* ---------- Rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.row {
  --ico: 104px;
  /* The app PNGs carry the macOS template margin: the visible tile starts this far inside the box. */
  --ico-inset: calc(var(--ico) * 0.095);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
}
.row:hover { border-color: var(--accent); }
/* Every row is a link and says so with the same chevron on its right edge: level with the icon on
   phones, on the row's middle line from 680px. */
.row::after {
  content: "";
  position: absolute;
  right: 23px;
  top: calc(20px + var(--ico) * 0.42);
  width: 9px;
  height: 9px;
  margin-top: -5px;
  border: solid var(--muted);
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.row:hover::after { border-color: var(--accent-ink); }
/* The shipped app icon. The box is pulled out by the PNG's margin, so the visible tile lines up with
   the row's padding and the text. .bleed is a full-bleed square, rounded here to the same visible size. */
.row-art { display: grid; place-items: center; width: var(--ico); height: var(--ico); margin: calc(var(--ico) * -0.08) 0 calc(var(--ico) * -0.1) calc(var(--ico-inset) * -1); }
.row-art picture { display: contents; }
.row-art img { display: block; width: 100%; height: 100%; }
.row-art img.bleed { width: 81%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 22.5%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.16); }
@media (prefers-color-scheme: dark) {
  /* A dark tile on a dark card keeps its outline. */
  .row-art img.bleed { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent), 0 6px 14px rgba(0, 0, 0, 0.3); }
}
.row-main { min-width: 0; }
.row-main h3 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.2rem); font-weight: 750; letter-spacing: -0.03em; margin: 0; }
/* The whole row is the link target; the name stays the accessible name. */
.row-main h3 a { color: var(--ink); text-decoration: none; }
.row-main h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-l); }
.row:hover h3 a { color: var(--accent-ink); }
.row-main h3 a:focus-visible { outline: none; }
.row-main h3 a:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.row-main p { color: var(--muted); font-size: 1.05rem; max-width: 46ch; margin: 0.5rem 0 0; }

/* Facts: system, price, status. The product hue is the status lamp only; the words stay ink. */
.row-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: center; font-size: var(--t-s); line-height: 1.35; color: var(--muted); }
.row-facts li { text-wrap: balance; }
.row-facts .price { color: var(--ink); font-weight: 600; }
.row-facts .status { display: flex; align-items: baseline; gap: 8px; color: var(--ink); font-weight: 600; }
.row-facts .status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* The price footnote mark: small, raised to the cap height, tight to the digits (as on the product pages). */
.ast { display: inline-block; margin-left: 0.06em; font-size: 0.5em; font-weight: 700; line-height: 1; vertical-align: 0.9em; letter-spacing: 0; }

@media (min-width: 680px) {
  .row { --ico: 128px; grid-template-columns: calc(var(--ico) * 0.82) minmax(0, 1fr); grid-template-areas: "art main" "art facts"; gap: 12px 28px; padding: 24px 56px 24px 28px; }
  .row::after { right: 24px; top: 50%; }
  .row-art { grid-area: art; align-self: center; margin-top: 0; margin-bottom: 0; }
  .row-main { grid-area: main; align-self: end; }
  .row-facts { grid-area: facts; align-content: start; }
}
/* Wide: icon, name, facts in one line, each centred on the row's middle line, where the chevron is.
   The facts box still takes the row's full height, so its divider does too. */
@media (min-width: 1040px) {
  .row { grid-template-columns: calc(var(--ico) * 0.82) minmax(0, 1fr) var(--facts-w); grid-template-areas: "art main facts"; gap: 32px; padding: 24px var(--row-end) 24px 32px; }
  .row::after { right: 28px; }
  .row-main { align-self: center; }
  .row-facts { align-self: stretch; align-content: center; padding-left: var(--facts-pad); border-left: 1px solid var(--line); }
  .row-facts li { white-space: nowrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .row-main h3 a, .row::after { transition: border-color 0.15s, color 0.15s, translate 0.15s; }
  .row:hover::after { translate: 3px 0; }
}

/* ---------- Support ---------- */
.support { display: grid; gap: 24px; margin-top: var(--section); }
/* "Support" is a heading of the same rank as a shelf's. */
.support h2 { font-size: var(--t-xl); }
.support p { color: var(--muted); font-size: 1.1rem; max-width: 40ch; margin: 16px 0 0; }
.support p a { color: var(--ink); }
.support-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.support-list li { border-bottom: 1px solid var(--line); }
.support-list a { display: flex; align-items: center; min-height: 46px; color: var(--ink); font-weight: 600; text-decoration: none; }
.support-list a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
/* Side by side the two columns share the top edge: the heading's cap line is on the list's top rule
   (the negative margin is the line box's own leading above the capitals) and the copy follows it. */
@media (min-width: 820px) {
  .support { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
  .support h2 { margin-top: -0.17em; }
}
@media (min-width: 1040px) {
  .support { grid-template-columns: minmax(0, 1fr) var(--side-w); }
}

/* ---------- Footer ---------- */
/* The copyright line takes the links' row height, so the rows of a wrapped footer are evenly spaced. */
.site-foot p { display: flex; align-items: center; min-height: 44px; }
