/* ============================================================
   /manage — the page's own blocks (site/src/pages/manage.astro, moved off Webflow)
   Requires: tokens.css, page.css, surface.css, word-pills.css
   Ported from the live embeds: embed/manage-pills-embed.html (first-screen pills), embed/manage-ais-embed.html
   (the sticky «A lot of ad tools…» statement), embed/manage-aichat-embed.html (the AI bento: promo, chat,
   accordion). Motion as on live; values on tokens. Phones (≤767): every block in plain flow, as live.
   ============================================================ */

/* ---------- First screen: the page's shapes in WordPills (em of --ps) ---------- */
/* «Scale» flag: flat left, pointed right; the fill runs a little above and below the pill box (live 97 on a 77 box) */
.manage-pills__flag {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  width: 3.25em;   /* 169 */
  height: 1.481em; /* 77 — the pill box; the fill runs 11 above and 9 below it */
  padding-block: 0.212em 0.172em;
  margin-block: -0.212em -0.172em;
  background: var(--color-primary);
  clip-path: polygon(100% 85.567%, 0% 100%, 0% 0%, 100% 14.433%);
}
.manage-pills__flag span { line-height: 1; }
/* phones: the staircase lines sit 0.15em apart — the fill above and below takes its own room there, or it touches
   «your campaigns»; live's absolute staircase left ~0.13em */
.word-pills--phone .manage-pills__flag { margin-block: 0; }
/* live: the «AI-powered ad» line sits 0.285em under the icon line, the others ~0.15em */
.word-pills--phone.manage-pills .word-pills__line:nth-child(4) { margin-top: 0.135em; }
/* the campaign (folder) icon on a light-blue tile */
.manage-pills__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.481em;
  height: 1.481em;
  border-radius: 0.308em;
  background: var(--color-accent-light-blue);
}
.manage-pills__icon svg { width: 1.0385em; height: 1.0385em; stroke: var(--color-accent-blue); }

/* ---------- «A lot of ad tools…» — a sticky statement on a 200vh runway ----------
   Tablets and desktop: the block sticks under the menu while the runway scrolls by; the robot and the alien come in
   when it is 30% on screen, the green card flies in at a quarter of the runway and the heading steps down to 0.8.
   Their eyes follow the cursor (script on the page). Phones: plain flow — characters in a row, the heading, the card. */
.manage-ais-rail { position: relative; height: 200vh; overflow-x: clip; } /* clip, not hidden: hidden breaks sticky */
.manage-ais {
  position: sticky;
  top: var(--nav-height, 0rem);
  height: calc(100svh - var(--nav-height, 0rem));
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--pad-horizontal);
}
/* as wide as the heading: the characters are placed against its corners */
.manage-ais__content { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: calc(var(--space-2xl) * -0.8); }
.manage-ais__chars { display: contents; }
.manage-ais__heading {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  transform-origin: center top;
  transition: transform var(--duration-spring) var(--ease-spring); /* moves with the landing card: one scene, one Spring */
}
.manage-ais__heading--small { transform: scale(0.8); }
.manage-ais__heading-mb { display: none; }

.manage-ais__card {
  position: absolute;
  inset-inline: 0;
  top: 0; /* set by the script: just under the heading */
  z-index: 2;
  width: min(38.5rem, 80%);
  margin: auto;
  padding: var(--space-xs); /* the green rim around the dotted frame (live 10) */
  border-radius: var(--radius-xl);
  background: var(--color-accent-green);
  will-change: transform;
  transform: rotate(-3.595deg) translateY(120vh);
}
@keyframes manage-ais-card-in {
  from { transform: rotate(-25deg) translateY(120vh); }
  to   { transform: rotate(-3.595deg) translateY(0); }
}
.manage-ais__card--visible { animation: manage-ais-card-in var(--duration-spring) var(--ease-spring) forwards; }
.manage-ais__card--instant { transform: rotate(-3.595deg) translateY(0); } /* reloaded already in view: no replay */
.manage-ais__card-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9.875rem;
  padding: var(--space-md) var(--space-lg);
  border: var(--border-thick) dotted var(--color-bg); /* live 5 → 4, as the dotted CTA */
  border-radius: var(--radius-lg); /* nested: 24 − the 8 rim = 16, as live */
}
.manage-ais__card-text { margin: 0; text-align: center; color: var(--color-text-inverted); }

.manage-ais__robot, .manage-ais__alien { position: absolute; z-index: 3; pointer-events: none; opacity: 0; }
/* the robot: on the heading's top-left corner, 3rem into it; the alien: on its bottom-right corner */
.manage-ais__robot {
  right: calc(100% - 3rem);
  top: -5rem;
  width: 10.5rem;
  aspect-ratio: 1;
  transform: rotate(-13.59deg) translateY(var(--reveal-rise));
  transition: opacity var(--duration-reveal) var(--ease-reveal), transform var(--duration-reveal) var(--ease-reveal); /* the Reveal character: the robot, then the alien one step later */
}
.manage-ais__alien {
  left: calc(100% - 3rem);
  bottom: -7rem;
  width: 14.375rem;
  aspect-ratio: 175 / 149;
  transform: rotate(-16.84deg) translateY(var(--reveal-rise));
  transition: opacity var(--duration-reveal) var(--ease-reveal) var(--reveal-step), transform var(--duration-reveal) var(--ease-reveal) var(--reveal-step);
}
.manage-ais__robot--visible { opacity: 1; transform: rotate(-13.59deg) translateY(0); }
.manage-ais__alien--visible { opacity: 1; transform: rotate(-16.84deg) translateY(0); }
.manage-ais__body { position: relative; width: 100%; height: 100%; will-change: transform; container-type: inline-size; } /* the eyes are sized from the character's width (cqi): they stay in proportion at any size */
.manage-ais__body img { display: block; width: 100%; height: 100%; object-fit: contain; }
.manage-ais__eye {
  position: absolute;
  width: 13.33cqi; /* live 22.4 at a 168 robot */
  height: 13.33cqi;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.manage-ais__alien .manage-ais__eye { width: 6.61cqi; height: 11.13cqi; border-radius: 0; } /* live 15.2 × 25.6 at a 230 alien */
.manage-ais__pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7.14cqi;
  height: 7.14cqi;
  border-radius: 50%;
  background: var(--color-bg); /* live 75% black */
  transform: translate(-50%, -50%);
  will-change: transform;
}
.manage-ais__alien .manage-ais__pupil { width: 4.17cqi; height: 4.17cqi; border-radius: 0; background: var(--color-bg-white); } /* live 90% white */

@media (max-width: 47.9375rem) {
  .manage-ais-rail { height: auto; }
  /* a statement (.statement, patterns.css): a section gap above (it is not a .section), then the pattern's own air —
     taller than 60% of the screen, so 32 inside: 96 on both sides */
  .manage-ais { position: relative; top: auto; height: auto; margin-top: var(--section-space); }
  .manage-ais__content { width: 100%; margin-top: 0; }
  .manage-ais__chars { display: flex; justify-content: center; align-items: flex-start; gap: var(--space-xs); width: 100%; margin-bottom: var(--space-md); } /* the tilted characters reach below their boxes: 32 keeps them off the heading */
  .manage-ais__heading-dt { display: none; }
  .manage-ais__heading-mb { display: inline; }
  /* scaled to the screen, not fixed: the heading one step down (H2, not Display) and the characters as parts of the
     row's width — at 320 the fixed 123 + 170 px characters and Display text left no room */
  .manage-ais__heading { width: 100%; font-size: var(--text-h2-size); line-height: var(--text-h2-lh); letter-spacing: var(--text-h2-ls); }
  .manage-ais__robot, .manage-ais__alien { position: relative; inset: auto; flex-shrink: 0; }
  .manage-ais__robot {
    width: 30%;
    transform: rotate(-13.59deg) translateX(-120%);
    transition: opacity var(--duration-reveal) var(--ease-reveal), transform var(--duration-spring) var(--ease-spring); /* phones: they slide in from the sides and land — Spring */
  }
  .manage-ais__robot--visible { transform: rotate(-13.59deg) translateX(0); }
  .manage-ais__alien {
    width: 41%;
    transform: rotate(-16.84deg) translateX(120%);
    transition: opacity var(--duration-reveal) var(--ease-reveal) var(--reveal-step), transform var(--duration-spring) var(--ease-spring) var(--reveal-step);
  }
  .manage-ais__alien--visible { transform: rotate(-16.84deg) translateX(0); }
  .manage-ais__card { position: relative; inset: auto; width: 85%; margin: var(--space) auto 0; transform: rotate(-7.19deg) translateY(100vh); }
  @keyframes manage-ais-card-in-mb {
    from { transform: rotate(-20deg) translateY(100vh); }
    to   { transform: rotate(-7.19deg) translateY(0); }
  }
  .manage-ais__card--visible { animation: manage-ais-card-in-mb var(--duration-spring) var(--ease-spring) forwards; }
  .manage-ais__card--instant { animation: none; transform: rotate(-7.19deg) translateY(0); }
  .manage-ais__card-inner { min-height: 0; padding: var(--space); }
}
@media (prefers-reduced-motion: reduce) {
  .manage-ais__robot, .manage-ais__alien, .manage-ais__heading { transition: none; }
  .manage-ais__card--visible { animation: none; transform: rotate(-3.595deg) translateY(0); }
}

/* ---------- AI bento: the promo picture, the chat, the accordion — three cards of four columns ---------- */
.manage-ai { align-items: stretch; }
/* the promo: the live SVG pictures (pills + the bird) on Indigo, the box proportions from the live card (400 × 530;
   phones 280 × 195) */
.manage-ai__promo { position: relative; overflow: hidden; display: flex; align-items: center; padding: 0; background: var(--color-accent-indigo); }
.theme-dark .card.manage-ai__promo { background: var(--color-accent-indigo); }
.manage-ai__promo-inner { position: relative; width: 100%; aspect-ratio: 400 / 530; }
.manage-ai__promo-pills { position: absolute; left: 5.75%; top: 10.19%; width: 88.5%; height: auto; }
.manage-ai__promo-bird { position: absolute; left: 60.25%; top: 51.95%; width: 32.2%; height: auto; }

/* the chat card: the ChatCard component (chat-card.css, fill, size lg) centred on green, by % of the card's width as live */
.manage-ai__chat { display: flex; align-items: center; justify-content: center; padding: 9.5% 12%; background: var(--color-accent-green); }
.theme-dark .card.manage-ai__chat { background: var(--color-accent-green); }

@media (max-width: 47.9375rem) {
  .manage-ai__promo-inner { aspect-ratio: 280 / 195; }
  /* the pills on the card's text lines (--pad-card-fluid on both sides, as the accordion text above), centred in height
     (live 7.14% from the left) */
  .manage-ai__promo-pills { left: var(--pad-card-fluid); top: 50%; width: calc(100% - 2 * var(--pad-card-fluid)); transform: translateY(-50%); }
  .manage-ai__promo-bird { left: auto; right: var(--pad-card-fluid); top: 8.98%; width: 27.29%; } /* its right edge on the same line */
}

/* «External data triggers» — the full-width card: the air around its picture is the shared full-width card rule
   (product-blocks.css) */

/* the Loop case under the feature bento: one grid gap, as the /stage case (stage.css .stage-case) */
.manage-case { margin-top: var(--grid-gap); }
