/* Hero: the headline, then the PILOT client itself, working (module M3).
   Desktop: the fitted headline takes columns 1–7 with the copy and CTA
   beside it on 8–12, set on the headline's last line; below them the client
   window spans the container (client.css), sized to the viewport so its strip,
   top bar and the head of every screen are in the first view. Tablet: one
   column. Phone: headline, copy and CTA, then the client in its phone layout.
   The client carries the motion; the headline only rises in once. */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: calc(76px + clamp(24px, 4.2vh, 52px)) clamp(64px, 7vw, 112px);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 1.7vw, 28px);
  align-items: end;
}

/* ── Kicker and headline ──────────────────────────────── */
.hero-kicker {
  grid-column: 1 / -1;
  margin-block-end: clamp(12px, 1.4vw, 20px);
  font: 500 13px/1.4 var(--font-text);
  letter-spacing: .01em;
  color: var(--muted);
}
.kicker-sep { margin-inline: 2px; color: var(--faint); }
.hero-title {
  grid-column: 1 / span 7;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fit, clamp(52px, 6vw, 96px));
  line-height: .94;
  letter-spacing: -.05em;
  overflow-wrap: break-word;
  color: var(--bone);
}
:is(:lang(zh), :lang(ja), :lang(ko)) .hero-title {
  font-size: var(--fit, clamp(52px, 6.2vw, 100px));
  line-height: 1.06;
  letter-spacing: -.03em;
}
/* The rise mask: a clip with headroom, so tall marks and descenders (the
   Latvian ņ cedilla, Vietnamese stacks) are never cut. */
.hero-line { display: block; clip-path: inset(-.35em -.1em -.3em -.1em); }
.hero-line > span { display: inline-block; max-width: 100%; }
/* The second line is set in bone like the first; the autopilot is not paint
   but a lamp before it, lit in the signal (grey when off). It hangs in the
   margin, so both lines keep one hard edge, and breathes while the autopilot
   works. Its net advance is zero (fit.js measures it all the same). */
.hero-accent { color: inherit; }
.hero-lamp { --lamp: .19em; --hang: .13em; margin-inline: calc(-1 * var(--lamp) - var(--hang)) var(--hang); vertical-align: .29em; }
.hero-line:has(> span > .hero-lamp) { clip-path: inset(-.35em -.6em -.3em -.6em); }
:is(:lang(zh), :lang(ja), :lang(ko)) .hero-lamp { --lamp: .17em; --hang: .12em; vertical-align: .33em; }
.hero-title:is(:lang(ar), :lang(he)) .hero-lamp { vertical-align: .36em; }

/* ── Copy, set on the headline's last line ────────────── */
.hero-copy { grid-column: 8 / -1; min-width: 0; padding-block-end: .35em; }
.hero-description { max-width: 32em; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.6; color: var(--muted); text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-block-start: 24px; }
/* "See the demo" scrolls to the demo panel: a plain link with a down arrow, not a play button. */
.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: text-decoration-color var(--t-ui) var(--ease);
}
.demo-link svg { width: 16px; height: 16px; stroke-width: 2; transition: translate var(--t-ui) var(--ease); }
.demo-link:hover { text-decoration-color: currentColor; }
.demo-link:hover svg { translate: 0 3px; }
.hero-footnote { display: flex; flex-direction: column; gap: 7px; margin-block-start: 24px; font-size: 13px; line-height: 1.45; color: var(--faint); }
.hero-footnote li { display: flex; align-items: center; gap: 8px; }
.hero-footnote svg { width: 15px; height: 15px; color: var(--muted); }
@media (min-width: 641px) {
  .hero-footnote { flex-flow: row wrap; gap: 6px 18px; margin-block-start: 16px; font-size: 12.5px; }
  .hero-footnote li { gap: 6px; }
  .hero-footnote svg { width: 14px; height: 14px; }
}

/* ── The client ───────────────────────────────────────── */
.hero-stage { margin-block-start: clamp(32px, 3.6vw, 56px); }
/* Until its script has built it, the window holds its size as a quiet frame. */
.cw:not(.is-ready) .cw-strip { min-block-size: 46px; }

/* ── Entrance: once, on the final text ────────────────── */
html.is-localized .hero-line > span { animation: hero-rise 1.1s var(--ease) both; }
html.is-localized .hero-line + .hero-line > span { animation-delay: .12s; }
html.is-localized .hero-kicker { animation: hero-fade-up .9s var(--ease) both; }
html.is-localized .hero-description { animation: hero-fade-up .9s var(--ease) .25s both; }
html.is-localized .hero-actions { animation: hero-fade-up .9s var(--ease) .32s both; }
html.is-localized .hero-footnote { animation: hero-fade-up .9s var(--ease) .46s both; }
html.is-localized .hero-stage { animation: hero-fade-up 1s var(--ease) .38s both; }

@keyframes hero-rise { from { transform: translateY(calc(100% + .2em)); } to { transform: none; } }
@keyframes hero-fade-up { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

/* ── Narrow desktop: the copy needs more of the row ───── */
@media (max-width: 1200px) and (min-width: 1001px) {
  .hero-title { grid-column: 1 / span 6; }
  .hero-copy { grid-column: 7 / -1; }
}

/* ── Tablet: one column; the copy runs in two under the headline ── */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero-kicker, .hero-title, .hero-copy { grid-column: 1; }
  .hero-title { font-size: var(--fit, clamp(48px, 7.4vw, 72px)); }
  .hero-copy { margin-block-start: 32px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .hero-description { grid-column: 1; }
  .hero-actions, .hero-footnote { grid-column: 2; }
  .hero-actions { grid-row: 1; margin-block-start: 0; }
  .hero-footnote { grid-row: 2; }
}

/* ── Phone ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding-block: calc(64px + 32px) 48px; }
  .hero-title { font-size: var(--fit, 44px); }
  :is(:lang(zh), :lang(ja), :lang(ko)) .hero-title { font-size: var(--fit, 48px); }
  .hero-copy { display: block; margin-block-start: 20px; }
  .hero-description { font-size: 15.5px; line-height: 1.6; }
  .hero-actions { margin-block-start: 20px; gap: 6px 20px; }
  .hero-actions .button { width: 100%; }
  .kicker-sep, .kicker-platforms { display: none; }
  .hero-footnote { margin-block-start: 16px; }
  .hero-stage { margin-block-start: 32px; }
  /* The window runs edge to edge on a phone, as the phone's own screen would. */
  .hero-stage.container { width: min(100%, 100% - 16px); }
}
[data-trial-cta] { white-space: normal; overflow-wrap: anywhere; text-align: center; max-inline-size: 100%; }
.header-actions .button-small[data-trial-cta] { white-space: normal; max-inline-size: min(40vw, 220px); line-height: 1.4; }
