/* Selected hero: one headline, native actions and the product card (HOME-02).
   Type, card and gaps share the small viewport's vertical budget. */
@layer base, components, utilities;
@layer components {
body[data-home-page] {
  /* One canvas for the whole page: sections are separated by space, and the
     single dark band, not by near-identical greys. */
  --hero-paper: var(--site-color-paper);
  --hero-ink: var(--site-color-ink);
  --hero-yellow: var(--site-color-accent);
  --hero-muted: var(--site-color-muted);
  --hero-line: var(--site-color-control-line);
  --hero-title-size: var(--type-display-1-size);
  --hero-logo-block: calc(104px + var(--hero-gap-logos) - 16px);
  --hero-lead: clamp(40px, calc(16svh - 96px), 112px);
  --hero-gap-description: clamp(16px, calc(4svh - 12px), 32px);
  --hero-gap-actions: clamp(24px, calc(6svh - 18px), 48px);
  --hero-gap-card: clamp(32px, calc(8svh - 24px), 64px);
  --hero-gap-logos: clamp(40px, calc(8svh - 24px), 64px);
}
.hero-seated {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  min-height: calc(90svh - var(--hero-logo-block));
  margin: 0;
  padding: var(--site-space-24) var(--site-space-16) 0;
  background: var(--hero-paper);
  color: var(--hero-ink);
}
.hero-seated-inner {
  display: grid; flex: 1; width: 100%; max-width: 1200px; margin: 0 auto;
  align-content: end;
  /* Keep the card with its copy. Spare height belongs above the copy;
     max-content rows cannot stretch below the image or inside the copy. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) max-content minmax(var(--hero-gap-card), var(--hero-gap-logos)) max-content;
}
.hero-seated-copy { grid-row: 2; text-align: center; }
.hero-seated h1 {
  margin: 0;
  color: var(--hero-ink);
  font-family: var(--type-font-text);
  font-size: var(--hero-title-size);
  font-weight: var(--type-display-1-weight);
  line-height: var(--type-display-1-line);
  letter-spacing: var(--type-display-1-track);
  white-space: nowrap;
}
.hero-seated-description {
  margin: var(--hero-gap-description) auto 0;
  color: var(--hero-muted);
  font-size: var(--type-body-lg-size);
  line-height: var(--type-line-body);
  text-wrap: balance;
}
.hero-seated-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: var(--site-space-8); margin-top: var(--hero-gap-actions); }
/* SITE-BUTTON-01: buttons come from .site-button; the hero sets only their row. */
.hero-seated a:focus-visible { outline: var(--site-focus-ring); outline-offset: var(--site-space-2); }
.hero-seated .hero-agent { grid-row: 4; justify-self: center; width: min(100%, 470px); margin: 0; }
/* The product card (HOME-02). Every measure is the Figma card's own value, so the
   start state matches the design; /hero-agent.js only moves things inside it. */
.hero-agent {
  /* Demo-only status colours, kept equal to the Actual Result icons (hero-agent/*-circle.svg);
     exempt from the site token rule (tests/fixtures/shared-css-policy.json). */
  --hero-status-pass: #12B76A; --hero-status-warn: #F79009; --hero-status-fail: #F04438;
  box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
  background: var(--site-color-paper);
  border: 1px solid var(--site-color-line);
  border-radius: 20px;
  box-shadow: 0 16px 48px color-mix(in srgb, var(--site-color-stego) 14%, transparent);
  color: var(--site-color-stego);
  font-family: var(--type-font-text);
  /* The Figma card was set in a narrower face than Inter: this keeps its sentences on one line. */
  letter-spacing: var(--type-track-heading);
  text-align: left;
}
.hero-agent-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--site-space-8) var(--site-space-12); padding: var(--site-space-12) var(--site-space-16); border-bottom: 1px solid var(--site-color-line); }
.hero-agent-title { display: flex; align-items: center; gap: var(--site-space-4); font-size: var(--type-card-title-size); font-weight: var(--type-weight-semibold); line-height: var(--type-line-code); white-space: nowrap; }
.hero-agent-mark { width: 10px; height: 10px; border-radius: 5px; background: var(--site-color-accent); }
.hero-agent-devices { display: flex; gap: var(--site-space-4); }
.hero-agent-chip { display: flex; align-items: center; gap: var(--site-space-6); box-sizing: border-box; padding: 5px var(--site-space-12) 5px var(--site-space-8); border: 1px solid var(--site-color-line); border-radius: var(--site-radius-pill); font-size: var(--type-body-sm-size); line-height: var(--type-line-code); white-space: nowrap; }
.hero-agent-body { padding: 14px var(--site-space-16); }
.hero-agent-view { position: relative; width: 100%; height: 307px; overflow: hidden; }
.hero-agent-list { display: flex; flex-direction: column; gap: 13.419px; transition: transform .6s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.hero-agent-row { box-sizing: border-box; flex: none; overflow: hidden; background: var(--site-color-paper); border: .839px solid var(--site-color-line); border-radius: 6.71px; transition: opacity .3s, transform .3s; }
.hero-agent-row.is-off { opacity: 0; transform: translateY(10px); }
.hero-agent-row-head { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: var(--site-space-8); height: 50.32px; padding: 13.419px 13.419px 13.419px 15.097px; background: var(--site-color-hero); border-bottom: .839px solid transparent; font-size: var(--type-body-sm-size); line-height: var(--type-line-body); }
.hero-agent-row.is-open .hero-agent-row-head { border-bottom-color: var(--site-color-line); }
.hero-agent-row-id { display: flex; align-items: center; gap: 10.065px; min-width: 0; }
.hero-agent-no { flex: none; min-width: 9.226px; font-weight: var(--type-weight-semibold); color: var(--site-color-placeholder); }
.hero-agent-code { flex: none; font-weight: var(--type-weight-semibold); color: var(--site-color-ink); white-space: nowrap; }
.hero-agent-bar { flex: none; width: .839px; height: 10.065px; background: var(--site-color-line); }
.hero-agent-name { min-width: 0; overflow: hidden; font-weight: var(--type-weight-regular); color: var(--site-color-ink); text-overflow: ellipsis; white-space: nowrap; }
.hero-agent-row.is-open .hero-agent-code { font-weight: var(--type-weight-regular); }
.hero-agent-row.is-open .hero-agent-name { font-weight: var(--type-weight-semibold); }
.hero-agent-tools { display: flex; flex: none; align-items: center; gap: 6.71px; }
.hero-agent-tools .hero-agent-bar { height: 13.419px; }
.hero-agent-tool { display: flex; align-items: center; justify-content: center; width: 23.484px; height: 23.484px; border-radius: 3.355px; transition: background .2s, transform .2s; }
.hero-agent-tool.is-pressed { background: var(--site-color-control-active); transform: scale(.86); }
.hero-agent-icon { display: block; width: 16.774px; height: 16.774px; }
.hero-agent-up { display: none; }
.hero-agent-row.is-open .hero-agent-up { display: block; }
.hero-agent-row.is-open .hero-agent-down { display: none; }
.hero-agent-panel { position: relative; height: 255px; overflow: hidden; transition: height .7s cubic-bezier(.4, 0, .2, 1); }
.hero-agent-row:not(.is-open) .hero-agent-panel { height: 0; }
.hero-agent-scroll { position: relative; transition: transform .7s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.hero-agent-content { display: flex; flex-direction: column; gap: 13.419px; padding: 13.419px; }
.hero-agent-info { display: flex; flex-direction: column; gap: 13.419px; padding-bottom: 6.71px; }
.hero-agent-block { display: flex; flex-direction: column; gap: 3.355px; }
.hero-agent-label { margin: 0; font-size: var(--type-caption-size); font-weight: var(--type-weight-semibold); line-height: var(--type-line-body); color: var(--site-color-caption); transition: opacity .3s; }
.hero-agent-lines { margin: 0; padding: 0 0 0 20.1285px; font-size: var(--type-body-sm-size); line-height: var(--type-line-code); color: var(--site-color-ink); }
.hero-agent-lines li { transition: opacity .35s, transform .35s; }
.hero-agent-run { display: flex; flex-direction: column; gap: 20.129px; transition: opacity .5s; }
.hero-agent-rule { height: .839px; background: var(--site-color-line); }
.hero-agent-run-body { display: flex; flex-direction: column; gap: 13.419px; }
.hero-agent-run-title { display: flex; align-items: center; gap: 6.71px; font-size: var(--type-body-sm-size); font-weight: var(--type-weight-semibold); line-height: var(--type-line-body); color: var(--site-color-ink); white-space: nowrap; }
.hero-agent-phone { display: block; flex: none; color: var(--site-color-ink); }
.hero-agent-ai { display: block; width: 16.774px; height: 16.774px; }
.hero-agent-steps { position: relative; display: flex; flex-direction: column; gap: 6.71px; }
.hero-agent-line { position: absolute; display: block; width: .839px; transform-origin: top; transition: transform .45s ease-out; }
.hero-agent-line.is-off { transform: scaleY(0); }
.hero-agent-step { display: flex; align-items: flex-start; gap: 6.71px; transition: opacity .35s, transform .35s; }
.hero-agent-step.is-off { opacity: 0; transform: translateY(6px); }
.hero-agent-dot-slot { display: flex; flex: none; align-items: center; justify-content: center; width: 16.774px; padding-top: 6.71px; }
.hero-agent-dot { display: block; box-sizing: content-box; width: 13.419px; height: 13.419px; padding: 1.677px; border-radius: var(--site-radius-circle); }
.hero-agent-step.is-active .hero-agent-dot { animation: hero-agent-ring 1.1s infinite; }
@keyframes hero-agent-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--site-color-error) 40%, transparent); } 100% { box-shadow: 0 0 0 6px transparent; } }
.hero-agent-step-body { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 6.71px; min-width: 1px; padding: 6.71px; overflow: hidden; border-radius: 3.355px; transition: background .3s; }
.hero-agent-step.is-active .hero-agent-step-body, .hero-agent-step-body:hover { background: var(--site-color-hero); }
.hero-agent-said { margin: 0; font-size: var(--type-caption-size); line-height: var(--type-line-body); color: var(--site-color-secondary); }
.hero-agent-said span { display: inline-block; clip-path: inset(0 0 0 0); transition: clip-path .75s steps(62, end); }
.hero-agent-said.is-hidden span { clip-path: inset(0 100% 0 0); transition: none; }
.hero-agent-act { display: flex; align-items: center; gap: 3.355px; font-size: var(--type-caption-size); font-weight: var(--type-weight-semibold); line-height: var(--type-line-body); color: var(--site-color-ink); white-space: nowrap; transition: opacity .3s, transform .3s; }
.hero-agent-act.is-off { opacity: 0; transform: translateX(-5px); }
.hero-agent-click { display: block; width: 16.774px; height: 16.774px; }
.hero-agent-act.is-tapped .hero-agent-click { animation: hero-agent-tap .4s; }
@keyframes hero-agent-tap { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.hero-agent-result { display: flex; flex-direction: column; gap: 6.71px; box-sizing: border-box; width: 100%; padding: 13.419px 13.419px 16.774px; overflow: hidden; background: var(--site-color-alternate); border-radius: 3.355px; transition: opacity .45s, transform .45s; }
.hero-agent-result.is-off { opacity: 0; transform: translateY(10px); }
.hero-agent-result-title { margin: 0; font-size: var(--type-caption-size); font-weight: var(--type-weight-semibold); line-height: var(--type-line-body); color: var(--site-color-ink); white-space: nowrap; }
.hero-agent-outcomes { display: flex; flex-direction: column; gap: 6.71px; }
.hero-agent-outcome { display: flex; align-items: flex-start; gap: 3.355px; transition: opacity .35s, transform .35s; }
.hero-agent-outcome.is-off { opacity: 0; transform: translateX(-6px); }
.hero-agent-outcome p { flex: 1; min-width: 1px; margin: 0; font-size: var(--type-body-sm-size); line-height: var(--type-line-body); color: var(--site-color-ink); }
.hero-agent-outcome-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 18.452px; height: 18.452px; }
.hero-agent-outcome-icon img { display: block; width: 16.774px; height: 16.774px; }
.hero-agent-label.is-hidden, .hero-agent-lines li.is-hidden, .hero-agent-run.is-hidden { opacity: 0; }
.hero-agent-lines li.is-hidden { transform: translateX(-6px); }
.hero-agent-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--site-space-8) var(--site-space-16); padding: var(--site-space-12) var(--site-space-16) 14px; border-top: 1px solid var(--site-color-line); transition: background .5s; }
.hero-agent-stat { display: flex; align-items: center; font-size: var(--type-body-sm-size); line-height: var(--type-line-code); white-space: nowrap; }
.hero-agent-stat b { display: inline-block; margin-left: var(--site-space-4); font-size: var(--type-title-size); font-weight: var(--type-weight-semibold); line-height: var(--type-line-code); font-variant-numeric: tabular-nums; }
.hero-agent-stat b.is-bumped { animation: hero-agent-bump .4s; }
@keyframes hero-agent-bump { 40% { transform: scale(1.35); } }
.hero-agent-dot-pass, .hero-agent-dot-warn, .hero-agent-dot-fail { width: 8px; height: 8px; margin-right: var(--site-space-6); border-radius: var(--site-radius-circle); }
.hero-agent-dot-pass { background: var(--hero-status-pass); }
.hero-agent-dot-warn { background: var(--hero-status-warn); }
.hero-agent-dot-fail { background: var(--hero-status-fail); }
.hero-agent-meter { display: flex; flex: 1 1 64px; min-width: 64px; height: 6px; overflow: hidden; background: var(--site-color-control-active); border-radius: 3px; }
.hero-agent-meter i { display: block; width: 0; height: 6px; border-right: 1px solid var(--site-color-paper); box-sizing: border-box; transition: width .6s ease; }
.hero-agent-seg-pass { width: 50%; background: var(--hero-status-pass); }
.hero-agent-seg-warn { width: 25%; background: var(--hero-status-warn); }
.hero-agent-seg-fail { width: 25%; background: var(--hero-status-fail); }
.hero-seated + .customer-logos {
  --logo-control: var(--site-color-muted);
  --logo-control-strong: var(--site-color-ink);
  --logo-rule: var(--site-color-ink-16);
  /* A full-width band in the hero's own colour, with the logos kept to the
     page width: it reads as the foot of the hero, not as a separate box. */
  max-width: none;
  /* The centred 20px label already supplies 28px inside the 76px strip. */
  margin: calc(var(--hero-gap-logos) - var(--site-space-28)) 0 0;
  padding-inline: max(var(--site-space-16), calc((100% - 1200px) / 2));
  border-top: 0;
  background: var(--hero-paper);
}
.hero-seated + .customer-logos img { filter: none; }
.customer-logos .customer-logos-label {
  flex: none;
  margin: 0 var(--site-space-8) 0 0;
  color: var(--hero-muted);
  font-size: var(--type-body-sm-size);
  line-height: var(--type-line-body);
  white-space: nowrap;
}
/* A narrow card keeps the play and open controls so case titles stay readable. */
@media (max-width: 440px) {
  .hero-agent-extra { display: none; }
}
@media (max-width: 767px) {
  .hero-seated + .customer-logos { flex-wrap: wrap; height: auto; margin-top: calc(var(--hero-gap-logos) - var(--site-space-16)); padding-block: var(--site-space-16); row-gap: var(--site-space-8); }
  .customer-logos .customer-logos-label { width: 100%; margin: 0; text-align: center; }
  /* Keeps the pause control on the logo row once the strip may wrap. */
  .hero-seated + .customer-logos .customer-logos-viewport { flex-basis: 0; }
}

@media (max-width: 389px) {
  .hero-seated-actions { flex-direction: column; gap: var(--site-space-8); }
  .hero-seated-actions .site-button { width: 100%; }
}
@media (min-width: 600px) {
  .hero-seated { padding-inline: var(--site-space-24); }
  .hero-seated-inner { grid-template-rows: minmax(0, .5fr) max-content minmax(var(--hero-gap-card), var(--hero-gap-logos)) max-content; }
  .hero-seated-actions { gap: var(--site-space-12); }
}
@media (min-width: 768px) {
  body[data-home-page] { --hero-logo-block: calc(76px + var(--hero-gap-logos) - 28px); }
}
@media (min-width: 600px) and (max-width: 1023px) {
  /* A tall tablet may reveal the next section instead of filling its hero
     with an oversized lead. With no minimum height the empty .5fr row is 0.
     HOME-02: the copy starts 48px under the bar as on a wide screen; the rest of
     the former lead moves under the card, so the logo row keeps its place. */
  body[data-home-page] {
    --hero-tablet-lead: clamp(64px, calc(16svh - 64px), 96px);
    --hero-lead: var(--site-space-48);
    --hero-lead-rest: calc(var(--hero-tablet-lead) - var(--hero-lead));
  }
  .hero-seated { min-height: 0; padding-bottom: var(--hero-lead-rest, 0px); }
}
/* HOME-02: from 1024px the copy and the card sit side by side. */
@media (min-width: 1024px) {
  /* The hero is a fixed layout here: its height and gaps do not follow the
     window height, so the copy, buttons and logo row stay put at any size.
     The title keeps 64px and shrinks only where the copy column is too narrow
     for it beside the card (about 1024-1240px wide), never with window height. */
  body[data-home-page] {
    --hero-lead: var(--site-space-48);
    --hero-title-size: clamp(36px, calc(5.2vw - 2px), var(--site-space-64));
    --hero-gap-description: var(--site-space-32);
    --hero-gap-actions: var(--site-space-48);
    --hero-gap-logos: var(--site-space-64);
  }
  .hero-seated { min-height: 640px; }
  /* The logo row closes the hero rather than sitting on the next section's
     grey edge: 16px more white under it keeps hero and logos one block.
     The row itself stays where it was; only the next section moves down. */
  .hero-seated + .customer-logos { height: calc(var(--customer-logos-height) + var(--site-space-16)); padding-bottom: var(--site-space-16); }
  .hero-seated-inner {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: minmax(max-content, 1fr);
    align-items: center;
    column-gap: var(--site-space-48);
  }
  .hero-seated-copy { grid-area: 1 / 1; text-align: left; }
  /* The card starts at the top of the hero area so its foot keeps clear of the
     logo row; the copy stays centred in the same area and the logos do not move. */
  .hero-seated .hero-agent { align-self: start; margin-top: var(--site-space-24); }
  .hero-seated-description { margin-inline: 0; }
  .hero-seated-actions { justify-content: flex-start; }
  .hero-seated .hero-agent { grid-area: 1 / 2; }
}
/* Short phone and tablet screens only; from 1024px the hero keeps its fixed layout. */
@media (max-height: 500px) and (max-width: 1023px) {
  body[data-home-page] {
    --hero-lead: var(--site-space-16);
    --hero-lead-rest: 0px;
    --hero-gap-description: var(--site-space-8);
    --hero-gap-actions: var(--site-space-16);
    --hero-gap-card: var(--site-space-24);
    --hero-gap-logos: var(--site-space-24);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-seated *, .hero-seated *::before, .hero-seated *::after { animation: none; transition: none; }
  /* The card's pulses are set by more specific rules, so they are named here. */
  .hero-agent-step.is-active .hero-agent-dot, .hero-agent-act.is-tapped .hero-agent-click, .hero-agent-stat b.is-bumped { animation: none; }
}

}
