/* Hero: headline, the "one session on two screens" stage (laptop terminal +
   phone replica + beat bar) and the agent logo band below it. */

.hero {
  position: relative;
  padding-block: clamp(28px, 3.4vw, 52px) clamp(40px, 4.5vw, 64px);
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  width: 900px;
  height: 700px;
  right: -260px;
  top: -120px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}

.hero-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 28px clamp(32px, 5vw, 64px);
  align-items: end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.chip .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent);
}

.chip .chip-sep {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(38px, 5.4vw, 74px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.sub {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.65;
  color: var(--muted);
  max-width: 30em;
}

.sub b {
  color: var(--ink);
  font-weight: 500;
}

.cta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.ticks {
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  list-style: none;
  padding: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.ticks li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ticks svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

/* ---------- stage ---------- */
.stage {
  position: relative;
  margin: clamp(40px, 4vw, 56px) 0 0;
  min-height: 500px;
}

.stage .laptop {
  width: calc(100% - 170px);
}

.stage .phone {
  position: absolute;
  right: 0;
  top: 0;
  width: 244px;
  aspect-ratio: 280 / 560;
}

/* Phone-only: a slim strip of the computer terminal above the phone. */
.mini-desk,
.md-link {
  display: none;
}

.mini-desk {
  width: min(340px, 100%);
  border-radius: 12px;
  overflow: hidden;
  background: var(--d-term);
  box-shadow: var(--shadow-device);
}

.md-bar {
  height: 26px;
  font-size: 10.5px;
}

.md-bar .dots i {
  width: 8px;
  height: 8px;
}

.md-line {
  height: 40px;
  padding: 0 12px;
  font: 11.5px/40px var(--mono);
  color: var(--d-term-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-line .acc {
  color: var(--d-accent);
}

.md-line .ok {
  color: var(--d-ok);
}

.md-line .bad {
  color: #ff8080;
}

.md-line .dim {
  color: var(--d-faint);
}

.md-line .warn {
  color: var(--d-warn);
}

.md-link {
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.md-link svg {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

/* ---------- beats ---------- */
.beats-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 22px;
  width: calc(100% - 290px);
}

.beats {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.beats li {
  position: relative;
  padding-top: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--faint);
  transition: color 0.3s;
}

.beats li::before,
.beats li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  border-radius: 3px;
}

.beats li::before {
  right: 0;
  background: var(--line-strong);
}

.beats li::after {
  width: 0;
  background: var(--blue);
}

.beats b {
  display: block;
  font: 600 11px var(--mono);
  margin-bottom: 2px;
}

.beats li.on {
  color: var(--ink);
}

/* Beat lengths match the loop in home-motion.js. */
.beats li.on::after {
  animation: fill 2400ms linear forwards;
}

.beats li:nth-child(2).on::after {
  animation-duration: 1900ms;
}

.beats li:nth-child(3).on::after {
  animation-duration: 2000ms;
}

.beats li:nth-child(4).on::after {
  animation-duration: 3600ms;
}

.beats li.past::after {
  width: 100%;
}

.stage.paused .beats li.on::after,
.stage.paused .cur {
  animation-play-state: paused;
}

.anim-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
}

.anim-toggle:hover {
  border-color: var(--ink);
}

.anim-toggle svg {
  width: 14px;
  height: 14px;
}

.anim-toggle .i-play,
.anim-toggle[aria-pressed="true"] .i-pause {
  display: none;
}

.anim-toggle[aria-pressed="true"] .i-play {
  display: block;
}

.no-motion .anim-toggle {
  display: none;
}

/* ---------- agent logo band ---------- */
.logos {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.agents {
  padding-block: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 26px;
  font-size: 14px;
  color: var(--faint);
}

.agents .lead {
  color: var(--muted);
}

.agents .lead b {
  color: var(--ink);
  font-weight: 600;
}

.agents em {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.agents svg {
  width: 16px;
  height: 16px;
}

/* English runs about twice as wide as the Chinese headline, so on wide screens
   it takes the full row and the lede and buttons share the row below. */
@media (min-width: 1041px) {
  :lang(en) .hero-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  :lang(en) .hero-head > div:first-child {
    grid-column: 1 / -1;
  }

  :lang(en) .hero-head > div:last-child {
    display: contents;
  }

  :lang(en) .hero h1 {
    font-size: clamp(38px, 4.4vw, 58px);
  }

  :lang(en) .hero-head .cta {
    margin-top: 0;
    align-self: end;
    justify-content: flex-end;
  }
}

@media (max-width: 1040px) {
  .hero-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage .phone {
    width: 260px;
  }

  .stage .laptop {
    width: calc(100% - 150px);
  }

  .tty {
    font-size: 12.5px;
  }

  .beats-row {
    width: calc(100% - 280px);
  }

  .beats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .stage {
    min-height: 0;
    margin-top: 40px;
    display: grid;
    justify-items: center;
  }

  .stage .laptop {
    display: none;
  }

  .mini-desk {
    display: block;
  }

  .md-link {
    display: flex;
  }

  .stage .phone {
    position: relative;
    width: min(290px, 100%);
  }

  .beats-row {
    width: 100%;
  }
}
