/* UI-002 home hero as a front-page spread (wide-screen round 2026-10-11,
   evidence round 2026-11-10). The hero and the sections under it ride the
   shell container, so the page shares the header's left and right edge at
   every width. From 768px the H1's product list is one banner line that
   spans the measure, with the claim on the line under it. Under the claim
   the live figures are the evidence: three display numerals on an ink rule,
   each with its mono label and unit, and the source line and update note
   in quiet mono under them. From 1200px the support line takes the first
   third of the deck and the evidence the other two, so the first figure
   starts on the head's own second tick. Loads on the home page only, after
   chrome.css; the base hero rules stay in public.css, and sizes and colours
   here resolve to tokens. */

/* ---------- geometry ---------- */

/* --head-edge follows the shell container. --head-measure is the content
   width and --head-module one of its six tick columns; vw counts a classic
   scrollbar, so below the shell width they run up to 15px wide. */
.hero {
  --head-edge: max(var(--head-gutter), calc((100% - var(--size-container-shell)) / 2 + var(--head-gutter)));
  --head-measure: calc(min(100vw, var(--size-container-shell)) - 2 * var(--head-gutter));
  --head-module: calc(var(--head-measure) / 6);
}

/* The column ticks carry on across the outer margins on the same module, so
   a wide screen reads as one ruled sheet. The hero clips them at its edge. */
.hero-grid::before,
.hero-grid::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inline-size: 200%;
  background:
    repeating-linear-gradient(var(--tick-run), transparent 0 calc(100% / 12 - 1px), var(--color-border) 0 calc(100% / 12)) top / 100% var(--head-tick) no-repeat,
    repeating-linear-gradient(var(--tick-run), transparent 0 calc(100% / 12 - 1px), var(--color-border) 0 calc(100% / 12)) bottom / 100% calc(var(--head-tick) / 2) no-repeat;
}
.hero-grid::before { --tick-run: to left; inset-inline-end: 100%; }
.hero-grid::after { --tick-run: to right; inset-inline-start: 100%; }

/* The margin note sits in the middle of the gutter until the outer margin
   opens, then keeps its place beside the content column. */
.margin-note { left: max((var(--head-edge) - var(--space-3)) / 2, var(--head-edge) - var(--space-8)); }

/* ---------- ghost glyph ---------- */

/* The glyph never crosses the H1, the kicker or the ledger and never
   reaches the viewport edge. The headline's first line spans the measure,
   so inside the measure the glyph is a small ear in the last tick column
   above it, and the kicker rule stops one column short. From 1920px it
   moves out to the first tick column of the outer margin: the two zh glyphs
   stack as two 1em lines (the webfont has no vertical metrics) and the
   Latin word runs down the column on its side. Not shown under 768px,
   where the kicker row has no room beside its text. */
.hero .ghost { display: none; top: var(--space-1); right: var(--head-edge); line-height: 1; letter-spacing: 0; }
@media (min-width: 768px) {
  .hero .ghost { display: block; }
}
@media (min-width: 768px) and (max-width: 1919px) {
  .hero .kicker { margin-inline-end: var(--head-module); }
  .hero .ghost { font-size: calc(var(--head-module) * 0.36); -webkit-text-stroke: 1px var(--color-ghost); }
  :lang(en) .hero .ghost { font-size: calc(var(--head-module) / 3.2); }
}
@media (min-width: 1920px) {
  .hero .ghost { top: var(--space-3); right: calc(var(--head-edge) - var(--head-module)); inline-size: 1em; font-size: calc(var(--head-module) * 0.92); }
  :lang(en) .hero .ghost { inline-size: auto; writing-mode: vertical-rl; font-size: calc(var(--head-module) * 0.7); }
}

/* ---------- banner headline ---------- */

/* The H1 is a product list and a claim. Each zh list item is its own box,
   so a line breaks between items, never inside one. On phones the first two
   items (8.73em) fill the first line, up to the 3rem phone size. From 768px
   the whole list is one banner line that spans the measure (14.55em in zh,
   18.16em in en) and the claim takes the line under it. Each divisor
   adds 3-4% so the line still fits when a scrollbar narrows the
   measure. */
.hero-title-locale-zh { max-width: none; font-size: min(calc(var(--head-measure) / 9), calc(var(--text-heading) * 1.5)); }
.hero-title-locale-zh .h1-part { display: inline-block; }
.hero-title-locale-en { max-width: none; text-wrap: balance; }
@media (min-width: 768px) {
  .hero-title-locale-zh { font-size: calc(var(--head-measure) / 15.1); }
  .hero-title-locale-en { font-size: calc(var(--head-measure) / 18.8); }
}

/* ---------- first screen: hero rhythm ---------- */

/* Trimmed so the first row of categories shows on a 1440x900 screen and the
   coverage heading and first entry show on a phone. The kicker, claim and
   deck keep their order; only the air between them is tighter. */
.hero { padding-block: var(--space-5) var(--space-4); }
.hero .kicker { margin-block-end: var(--space-3); }
.hero-title { margin-block: 0; }
@media (min-width: 768px) {
  .hero { padding-block: var(--space-6); }
  .hero .kicker { margin-block-end: var(--space-5); }
}

/* ---------- deck: support line + the evidence ---------- */

.hero-deck { display: grid; row-gap: var(--space-2); margin-block-start: var(--space-3); }
.hero-deck .support { margin: 0; text-wrap: pretty; }
.hero-deck .support span { display: inline-block; }

/* The claim's evidence: the live figures as display numerals in the coverage
   count style, each with its mono label and unit. The markup order stays
   label, number, unit (it reads that way); the grid sets them number first,
   unit beside it, label under it. On phones the figures stack as ledger
   rows, number and unit at the start and the label at the row's end. */
.hero { --figure-size: var(--text-heading); }
.hero .chips {
  display: grid;
  gap: 0 var(--space-5);
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  line-height: var(--leading-mono);
}
.hero .chips .chip {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas: "n u l";
  align-items: baseline;
  column-gap: var(--space-2);
  padding: var(--space-2) 0;
  border: 0;
  border-block-end: 1px dashed var(--color-border-strong);
  background: none;
  font-size: inherit;
  color: var(--color-text-muted);
}
.hero .chip > b {
  grid-area: n;
  font-family: var(--font-display);
  font-size: var(--figure-size);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}
.hero .chip > b ~ span { grid-area: u; }
.hero .chip > span:first-child { grid-area: l; justify-self: end; }

/* The quiet line: where the figures come from, how, and when last checked,
   with the update note at its far end where the width allows. Mono at label
   size, values in ink. */
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  line-height: var(--leading-mono);
}
.hero .proof-line { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); margin: 0; }
.hero .proof-row { white-space: nowrap; color: var(--color-text-muted); }
.hero .proof-row > b { font-weight: var(--weight-medium); }
.hero .update-flag { margin: 0; font-family: var(--font-body); font-size: inherit; }

@media (min-width: 768px) {
  .hero-deck { row-gap: var(--space-3); margin-block-start: var(--space-4); }
  .hero { --figure-size: clamp(var(--text-heading), calc(var(--head-measure) / 20), var(--text-heading-lg)); }
  .hero .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero .chips .chip { grid-template-columns: auto 1fr; grid-template-areas: "n u" "l l"; padding-block: var(--space-3); }
  .hero .chip > span:first-child { justify-self: start; }
}

/* Under the banner the deck is two blocks on the tick grid: the support line
   in the first third, the evidence in the other two, so the first figure
   starts exactly under the second tick. */
@media (min-width: 1200px) {
  .hero { --figure-size: clamp(var(--text-heading), calc(var(--head-measure) / 28), var(--text-heading-lg)); }
  .hero-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0; margin-block-start: var(--space-6); }
  .hero-deck .support { grid-area: 1 / 1 / span 2; max-width: none; padding-inline-end: var(--space-8); font-size: clamp(var(--text-body-lg), calc(var(--head-measure) / 56), var(--text-heading-sm)); line-height: var(--leading-body-lg); }
  .hero .chips,
  .hero-notes { grid-column: 2 / -1; }
}

/* ---------- product categories: four families ---------- */

/* The ten categories hang under the four families the H1 names, in the
   H1's order, so the columns step down 1-2-3-4. Each entry is a ledger row:
   name left, live count right, entry arrow at the row's end. Credit cards,
   the largest category and a family of one, is the feature entry: from
   640px its name stands over its count at display scale and the note that
   says what the numbers count sits directly under it. */
.home-explore { padding-block: var(--space-5) var(--space-8); }
.home-explore .sec-head { margin-block-end: var(--space-4); }
@media (min-width: 768px) {
  .home-explore { padding-block-start: var(--space-6); }
  .home-explore .sec-head { margin-block-end: var(--space-5); }
}
.families { display: grid; gap: var(--space-8) var(--space-6); }
.family h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-heading-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  letter-spacing: -0.02em;
}
.family ul { list-style: none; margin: 0; padding: 0; }
/* On paper a family column and an article card stay on one page, and a
   section heading stays with what it heads. */
.family,
.home-article { break-inside: avoid; }
.home-explore .sec-head,
.insights-sec .sec-head { break-inside: avoid; break-after: avoid; }
.entry {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-block-end: 1px dashed var(--color-border-strong);
  color: inherit;
  text-decoration: none;
}
.entry-name { margin-inline-end: auto; font-weight: var(--weight-semibold); }
/* The arrow rests a step inside the row, so the focus ring clears it at
   rest and after its hover or focus step. */
a.entry { padding-inline-end: var(--space-2); }
a.entry::after { content: "→"; color: var(--color-accent-text); }
.entry-count { color: var(--color-text-muted); font-size: var(--text-label); white-space: nowrap; }
.entry-count b {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}
.entry-soon { color: var(--color-text-muted); }
/* A family of one category: its row is the heading, so the name shows once. */
.family-solo .entry { padding-block-start: 0; }
.family-solo .entry-name { margin: 0 auto 0 0; }
.family-solo .entry-count b { font-size: var(--text-heading-lg); }
.families-note { margin: var(--space-3) 0 0; max-inline-size: 36ch; color: var(--color-text-muted); font-size: var(--text-label); }
@media (min-width: 640px) {
  .families { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-solo .entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .family-solo .entry-name { grid-area: 1 / 1; }
  .family-solo a.entry::after { grid-area: 1 / 2; }
  .family-solo .entry-count { grid-area: 2 / 1 / auto / -1; }
  .family-solo .entry-count b { font-size: calc(var(--text-heading-lg) * 4 / 3); text-align: start; }
}
@media (min-width: 1200px) {
  .families { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
}

/* ---------- latest articles: a front page ---------- */

/* An ink rule opens the block. From 1024px the lead's cover stands on the
   left and the lead's date, headline, summary and byline on the right. From
   1360px the briefs join that right column under a rule, as text rows (date,
   title, byline and topic), so the column ends level with the cover; from
   1024px to there they sit in two columns under the spread. Below 1024px
   the cover leads at full width and the briefs follow as rows. Each card is an
   <article> whose title link stretches over it, so the writer name can be
   its own link (the blog list's pattern; those rules live in sheets the
   home page does not load). The cover is a link of its own beside the
   article, kept out of the tab order and the accessibility tree. Without a
   cover the lead takes the wide column and the briefs the narrow one. */
.home-articles { display: grid; gap: var(--space-4); padding-block-start: var(--space-4); border-block-start: 2px solid var(--color-text); }
.home-articles .home-article { position: relative; border-block-start: 0; padding-block: 0; }
.home-cover-link { display: block; }
.home-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--space-2);
}
.home-article .press-card-link { color: inherit; text-decoration: none; }
.home-article .press-card-link::after { content: ""; position: absolute; inset: 0; }
.home-article .byline-link {
  position: relative;
  z-index: 1;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 0.2em;
}
.home-article .byline-link b { color: inherit; }
/* The writer's avatar chip (UI-019) rides the name inside the byline. */
.home-article .ai-byline { display: inline-flex; align-items: center; gap: var(--space-1); }
.home-article .byline-link { display: inline-flex; align-items: center; gap: var(--space-1); }
/* The writer link's 44px target is a centred pseudo-element (the blog
   list's pattern), so neither the byline nor the meta row changes size. It
   rides the link's own layer, above the card's stretched title link. */
.home-article .byline-link::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: var(--chrome-min-target); /* contract minimumTargetPx: 44 */
  min-height: var(--chrome-min-target);
  transform: translate(-50%, -50%);
}
.home-article .byline-avatar {
  flex: none;
  inline-size: var(--space-5);
  block-size: var(--space-5);
  object-fit: cover;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}
.home-articles .home-article .meta { font-size: var(--text-label); }
.home-article p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0 0 var(--space-3);
  max-inline-size: 62ch;
  color: var(--color-text-muted);
}
.home-articles .home-article-lead h3 { margin: var(--space-2) 0 var(--space-3); font-family: var(--font-display); font-size: var(--text-heading-md); font-weight: var(--weight-bold); line-height: 1.3; }

/* The briefs: one ruled row each, the date at the start, the title beside
   it and the byline under the title. */
.home-briefs { display: grid; }
.home-briefs .home-article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: var(--space-4);
  padding-block: var(--space-3);
  border-block-start: 1px dashed var(--color-border-strong);
}
.home-briefs .home-article > .no { grid-column: 1; }
.home-briefs .home-article > h3 { grid-column: 2; margin: 0; font-size: var(--text-body-lg); line-height: 1.4; }
.home-briefs .home-article > .meta { grid-column: 2; margin-block-start: var(--space-1); }

@media (max-width: 767px) {
  .home-briefs .home-article > h3 { font-size: var(--text-body); }
}
@media (min-width: 1024px) {
  .home-articles { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-8); align-items: start; }
  .home-cover-link { grid-column: 1; grid-row: 1; }
  .home-article-lead { grid-column: 2; grid-row: 1; }
  .home-articles .home-article-lead h3 { font-size: var(--text-heading); }
  .home-articles:not(:has(> .home-cover-link)) .home-article-lead { grid-column: 1; }
  .home-articles:not(:has(> .home-cover-link)) .home-article-lead h3 { font-size: var(--text-heading-lg); line-height: var(--leading-heading-lg); }
  /* Below 1360px the right column would run well past the cover, leaving a
     gap under it, so the briefs take the row under the spread, side by side. */
  .home-briefs { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); }
  .home-articles:not(:has(> .home-cover-link)) .home-briefs { grid-column: 2; grid-row: 1; grid-template-columns: none; }
}
@media (min-width: 1360px) {
  .home-cover-link { grid-row: 1 / span 2; }
  .home-briefs { grid-column: 2; grid-template-columns: none; }
}

/* ---------- AI tools: one quiet line ---------- */

/* The page ends on the App panel. The coming-soon teaser is one quiet line
   under it, title, badge and note at label size; the panel gives up its
   usual gap so the line reads as the panel's footnote. */
.app-promo { --app-promo-gap: var(--space-4); }
.home-close .teaser { padding-block: 0; border-block: 0; gap: var(--space-1) var(--space-3); font-size: var(--text-label); }
.home-close .teaser b { font-family: var(--font-body); font-size: inherit; font-weight: var(--weight-semibold); }

/* ---------- motion ---------- */

/* One system for the page. The H1 is never animated: it is painted at once
   (it is the LCP element) and the evidence assembles around it.
   - Hero entrance, on load, CSS only, done in about a second: the claim's
     underline draws, the support line arrives, each ledger half draws its
     ink rule and its rows arrive in order while the live counts resolve
     (client count-up, held until the rows are in), then the update note.
   - Sections, once, as they enter the viewport (the shared reveal classes):
     each family draws its rule and its rows follow, stepping left to right.
   - Hover and keyboard focus answer the same way: the entry arrow steps
     forward and the row rule turns to ink; a card's title and cover frame
     take the accent and the ink.
   Everything moves by transform, opacity or paint, so nothing shifts. All
   of it sits behind `screen and (prefers-reduced-motion: no-preference)`:
   reduced motion and print get the finished composition with no animation
   declared. --i counts half steps of --duration-fast. */

/* The ink rules over the figures and the families are their own boxes so
   they can draw by transform. A live count keeps the width of its final
   value (a hidden copy of it, zero high, sets the box), so counting up moves
   nothing. The copy sits after the digits where the count is a grid item
   (its first baseline is the digits') and before them in running text (its
   last baseline is). */
.hero .chips::before,
.family::before { content: ""; display: block; block-size: 2px; background: var(--color-text); transform-origin: left center; }
.hero .chips::before { grid-column: 1 / -1; }
.family::before { margin-block-end: var(--space-3); }
.hero-title .rule-under { box-shadow: none; white-space: nowrap; background: linear-gradient(var(--color-press) 0 0) left bottom / 100% 0.12em no-repeat; }
.hero .chip b[data-n],
.entry-count b { display: inline-block; }
.hero .chip b[data-n]::after,
.entry-count b::before { content: attr(data-n); display: block; block-size: 0; overflow: hidden; visibility: hidden; }
.entry-count b { text-align: end; }

@keyframes rule-draw { from { transform: scaleX(0); } }
@keyframes underline-draw { from { background-size: 0 0.12em; } }

/* Hover and focus states (no travel here; the arrow's step is motion). */
a.entry:focus-visible { border-block-end-color: var(--color-text); }
/* The focused row grows a step past the column edge, so the ring clears the
   name as it clears the arrow; the name itself stays on the edge. */
a.entry:focus-visible { margin-inline-start: calc(-1 * var(--space-2)); padding-inline-start: var(--space-2); }
a.entry:focus-visible .entry-name { color: var(--color-accent-text); }
.home-article:has(.press-card-link:focus-visible) h3 { color: var(--color-accent-text); }
.home-articles:has(.home-article-lead .press-card-link:focus-visible) .home-cover { border-color: var(--color-text); }
.home-article .byline-link:focus-visible { color: var(--color-accent-text); }
.all-link:focus-visible { color: var(--color-text); border-block-end-color: var(--color-text); }
@supports selector(:has(a)) {
  .home-article .press-card-link:focus-visible { outline: none; }
  .home-article:has(.press-card-link:focus-visible) { outline: 0.1875rem solid var(--color-focus); outline-offset: var(--space-1); }
}
@media (hover: hover) {
  a.entry:hover { border-block-end-color: var(--color-text); }
  a.entry:hover .entry-name { color: var(--color-accent-text); }
  .home-cover-link:hover .home-cover,
  .home-articles:has(.home-article-lead:hover) .home-cover { border-color: var(--color-text); }
  .home-article .byline-link:hover { color: var(--color-accent-text); }
  .home-article:has(.byline-link:hover) h3 { color: var(--color-text); }
  .home-articles:has(.home-article-lead .byline-link:hover) .home-cover { border-color: var(--color-border-strong); }
  .all-link:hover { color: var(--color-text); border-block-end-color: var(--color-text); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  /* hero entrance */
  .hero-title .rule-under,
  .hero-deck .support,
  .hero .chips::before,
  .hero .chips .chip,
  .hero .proof-line,
  .hero .update-flag {
    animation: content-enter var(--duration-base) var(--ease-enter) both;
    animation-delay: calc(var(--duration-fast) * var(--i) / 2);
  }
  .hero-title .rule-under { --i: 2; animation-name: underline-draw; animation-duration: var(--duration-signature); }
  .hero-deck .support { --i: 3; }
  .hero .chips::before { --i: 5; animation-name: rule-draw; animation-duration: var(--duration-signature); }
  .hero .chips .chip:nth-child(1) { --i: 6; }
  .hero .chips .chip:nth-child(2) { --i: 7; }
  .hero .chips .chip:nth-child(3) { --i: 8; }
  .hero .proof-line { --i: 9; }
  .hero .update-flag { --i: 10; }

  /* sections: family rules draw, rows follow (--f family, --r row) */
  .family:nth-child(2) { --f: 1; }
  .family:nth-child(3) { --f: 2; }
  .family:nth-child(4) { --f: 3; }
  .family li:nth-child(2) { --r: 1; }
  .family li:nth-child(3) { --r: 2; }
  .family li:nth-child(4) { --r: 3; }
  .families.motion-reveal-run .family::before {
    animation: rule-draw var(--duration-signature) var(--ease-enter) both;
    animation-delay: calc(var(--duration-fast) * var(--f, 0) * 0.66);
  }
  .families.motion-reveal-run .entry {
    animation: content-enter var(--duration-base) var(--ease-enter) both;
    animation-delay: calc(var(--duration-fast) * (var(--f, 0) * 0.66 + var(--r, 0) * 0.5 + 1));
  }

  /* interaction */
  a.entry,
  .entry-name,
  .home-cover,
  .home-article .byline-link,
  .all-link { transition: color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); }
  a.entry::after { transition: transform var(--duration-fast) var(--ease-standard); }
  a.entry:focus-visible::after { transform: translateX(var(--space-1)); }
  @media (hover: hover) {
    a.entry:hover::after { transform: translateX(var(--space-1)); }
  }
}
