/* ============================================================
   Aqaris · AI Agents page (Figma "1440w dark" 63:1143,
   "768w dark" 63:1575, "390w dark" 63:1992)
   Loaded only by ai-agents.html, after style.css and home.css.
   The page body is "home agents": header, buttons, final CTA and
   footer come from home.css; everything here is scoped to
   body.agents or to ag-* classes.
   Breakpoints: desktop > 1024 · tablet 641–1024 · mobile ≤ 640
   ============================================================ */

.agents .nav-links a[aria-current="page"] { color: var(--hp-indigo); font-weight: 600; }

.ag-pill {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 14px;
  border-radius: 999px;
  background: var(--hp-lav);
  font-size: 14px; font-weight: 600; line-height: 22px;
  color: var(--hp-indigo);
}
.ag-icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hp-line);
  border-radius: 14px;
  background: #FFFFFF;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), transform .45s var(--hp-smooth);
}
.ag-icon-lg { width: 52px; height: 52px; }
.ag-btn-white { background: #FFFFFF; }

/* ---------- Hero ---------- */
.ag-hero { background: var(--hp-slate); padding: 88px 0 96px; overflow: hidden; }
.ag-hero-inner { display: flex; gap: 64px; align-items: center; }
.ag-hero-copy { flex: 0 1 596px; min-width: 0; }
.ag-hero h1 {
  margin-top: 21px;
  font-size: clamp(52px, 4.72vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.ag-hero-lead { max-width: 560px; margin-top: 26px !important; font-size: 20px; line-height: 1.5; }
.ag-hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.ag-hero-meta {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 12px 24px;
}
.ag-hero-meta li {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; line-height: 24px;
  color: var(--hp-body);
}

/* Product vignette: tenant chat + work-order toast */
.ag-visual {
  position: relative; isolation: isolate;
  flex: 0 0 540px; min-width: 0;
  padding: 28px 28px 64px;
  border-radius: 26px;
  background: linear-gradient(160deg, #2E2557 0%, #16142E 100%);
}
.ag-visual::before {
  content: ""; position: absolute; z-index: -1;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(142,139,255,.45) 0, rgba(142,139,255,0) 129px);
  pointer-events: none;
}
.ag-chat {
  position: relative;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
  overflow: hidden;
}
.ag-chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hp-line);
}
.ag-chat-avatar {
  flex: 0 0 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--hp-lav);
}
.ag-chat-who strong { display: block; font-size: 15.5px; font-weight: 600; line-height: 24px; color: var(--hp-ink); }
.ag-chat-who span { display: block; font-size: 13px; line-height: 20px; color: var(--hp-muted); }
.ag-chat-channels { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.ag-channel {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--hp-line);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1;
  color: var(--hp-muted);
}
.ag-channel-on { background: #E7F8EE; border-color: #BFE9CF; color: #15803D; }

.ag-chat-body {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px;
  background: #F7F7FB;
}
.agents .ag-msg {
  max-width: 78%;
  padding: 10px 14px;
  font-size: 14.5px; line-height: 21px;
  color: var(--hp-ink);
}
.ag-msg small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 16.7px; color: var(--hp-muted); }
.ag-msg-in {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid var(--hp-line);
  border-radius: 14px 14px 14px 4px;
}
.ag-msg-out {
  align-self: flex-end;
  background: var(--hp-lav);
  border-radius: 14px 14px 4px 14px;
}
.ag-msg-out small { color: #6D5FD0; }
.ag-escalated {
  align-self: center;
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  border: 1px solid #FECACA;
  border-radius: 999px;
  background: #FEF2F2;
  font-size: 12.5px; font-weight: 600; line-height: 1;
  color: #B91C1C;
}
.ag-escalated i { width: 7px; height: 7px; border-radius: 50%; background: #EF4444; }

.ag-workorder {
  position: absolute; z-index: 2;
  left: -36px; bottom: -32px;
  width: 300px;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--hp-line);
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 24px 48px -16px rgba(15,23,42,.35);
}
.ag-workorder-icon {
  flex: 0 0 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--hp-lav);
}
.ag-workorder strong { display: block; font-size: 15px; font-weight: 600; line-height: 23px; color: var(--hp-ink); }
.ag-workorder span { display: block; margin-top: 2px; font-size: 13px; line-height: 18.2px; color: var(--hp-muted); }
.ag-workorder em {
  display: inline-flex; align-items: center;
  height: 22px; margin-top: 8px; padding: 0 8px;
  border-radius: 6px;
  background: #FEF2F2;
  font-size: 12px; font-style: normal; font-weight: 600; line-height: 1;
  color: #B91C1C;
}

/* ---------- How they work ---------- */
.ag-head { max-width: 782px; }
.ag-head h2 { margin-top: 17px; }
.ag-how {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.ag-how-card {
  padding: 32px 30px;
  border: 1px solid var(--hp-line);
  border-radius: 20px;
  background: #FFFFFF;
  transition: transform .45s var(--hp-smooth), box-shadow .45s var(--hp-smooth), border-color .3s var(--ease);
}
.ag-how-card-featured { background: var(--hp-lav); border-color: #E4DAFF; }
.ag-how-top { display: flex; justify-content: space-between; align-items: center; }
.ag-how-num { font-size: 14px; font-weight: 600; line-height: 22px; color: var(--hp-indigo); }
.ag-how-card h3 { margin-top: 23px; font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.ag-how-card p { margin-top: 9px; font-size: 16.5px; line-height: 25.6px; }

/* ---------- The seven agents ---------- */
.ag-list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 80px; }
.ag-list-head h2 { margin-top: 17px; }
.ag-list-head p { flex: 0 1 401px; font-size: 18px; line-height: 1.55; }

.ag-list { margin-top: 48px; border-top: 2px solid var(--hp-ink); }
.ag-agent {
  position: relative; isolation: isolate;
  display: flex; gap: 48px;
  padding: 40px 0;
  border-bottom: 1px solid var(--hp-line);
}
.ag-agent-id { flex: 0 0 330px; min-width: 0; }
.ag-agent-tag {
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; font-weight: 600; line-height: 22px;
  color: var(--hp-muted);
  transition: color .3s var(--ease);
}
.ag-agent h3 { margin-top: 17px; font-size: 23px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.ag-agent-stat { margin-top: 17px; padding-top: 23px; border-top: 1px solid var(--hp-line); }
.ag-agent-stat strong {
  display: inline-block;
  font-size: 40px; font-weight: 700; line-height: 42px; letter-spacing: -0.03em;
  transition: transform .45s var(--hp-smooth);
  transform-origin: left center;
}
.ag-agent-stat span { display: block; margin-top: 5px; font-size: 14.5px; line-height: 20.3px; color: var(--hp-muted); }
.ag-agent-copy {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.ag-agent-copy h4 { font-size: 14px; font-weight: 600; line-height: 22px; color: var(--hp-muted); }
.ag-agent-copy h4.ag-label-task { color: var(--hp-indigo); }
.ag-agent-copy p { margin-top: 7px; font-size: 16px; line-height: 25.6px; }

/* Soft hover panel behind each agent row, kept inside the page gutter,
   with a brand accent on the left edge. */
.ag-agent::before {
  content: ""; position: absolute; z-index: -1;
  top: 8px; bottom: 8px; left: -24px; right: -24px;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 18px 40px -28px rgba(15,23,42,.25);
  opacity: 0; transform: scale(.985);
  transition: opacity .5s var(--hp-smooth), transform .5s var(--hp-smooth);
}
.ag-agent::after {
  content: ""; position: absolute;
  top: 32px; bottom: 32px; left: -24px;
  width: 3px; border-radius: 3px;
  background: var(--hp-accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform .6s var(--hp-smooth);
}

@media (hover: hover) {
  .ag-how-card:hover {
    transform: translateY(-4px);
    border-color: #C7C2F7;
    box-shadow: 0 22px 44px -26px rgba(15,23,42,.28);
  }
  .ag-how-card-featured:hover { box-shadow: 0 24px 48px -24px rgba(79,70,229,.4); }
  .ag-how-card:hover .ag-icon { border-color: #C7C2F7; transform: translateY(-2px); }

  .ag-agent:hover::before { opacity: 1; transform: none; }
  .ag-agent:hover::after { transform: scaleY(1); }
  .ag-agent:hover .ag-icon { background: var(--hp-lav); border-color: #C7C2F7; transform: translateY(-2px); }
  .ag-agent:hover .ag-agent-tag { color: var(--hp-indigo); }
  .ag-agent:hover .ag-agent-stat strong { transform: scale(1.04); }
}
/* style.css zeroes every transition under reduced motion; keep the hovers gentle, no movement. */
@media (prefers-reduced-motion: reduce) {
  .ag-how-card, .ag-agent::before, .ag-agent::after, .ag-icon, .ag-agent-tag { transition-duration: .3s !important; }
  .ag-how-card:hover, .ag-agent:hover .ag-icon, .ag-how-card:hover .ag-icon, .ag-agent:hover .ag-agent-stat strong { transform: none; }
}

/* ---------- Final CTA ---------- */
.agents .hp-cta h2 { flex-basis: 600px; }

/* ============================================================
   Small desktop (1025–1240): let fixed Figma columns flex
   ============================================================ */
@media (max-width: 1240px) {
  .ag-hero-inner { gap: 48px; }
  .ag-visual { flex-basis: 480px; }
  .ag-workorder { left: -24px; }
  .ag-agent { gap: 36px; }
  .ag-agent-id { flex-basis: 280px; }
  .ag-agent-copy { gap: 28px; }
  .ag-list-head { gap: 56px; }
  .agents .hp-cta h2 { flex-basis: 50%; }
}

/* ============================================================
   Tablet (≤ 1024) — "768w dark", 768 frame, 32px gutter
   ============================================================ */
@media (max-width: 1024px) {
  .ag-hero { padding: 64px 0 88px; }
  .ag-hero-inner { flex-direction: column; align-items: stretch; gap: 56px; }
  .ag-hero-copy { flex: none; }
  .ag-hero h1 { font-size: 52px; line-height: 1.05; }
  .ag-hero-lead { max-width: 550px; font-size: 18px; }
  .ag-visual { flex: none; }
  .ag-workorder { left: 24px; bottom: -31px; }

  .ag-br { display: none; }
  .ag-how { grid-template-columns: 1fr; gap: 16px; }

  .ag-list-head { display: block; }
  .ag-list-head p { max-width: none; margin-top: 18px !important; font-size: 17px; }
  .ag-agent { flex-direction: column; gap: 24px; padding: 32px 0; }
  .ag-agent-id { flex: none; }
  .ag-agent h3 { margin-top: 18px; }
  .ag-agent-stat { margin-top: 18px; padding-top: 22px; }
  .ag-agent-copy { gap: 28px; }
  .ag-agent::before { left: -20px; right: -20px; }
  .ag-agent::after { left: -20px; }

  .agents .hp-cta h2 { flex: none; }
}

/* ============================================================
   Mobile (≤ 640) — "390w dark", 390 frame, 20px gutter
   ============================================================ */
@media (max-width: 640px) {
  .ag-hero { padding: 48px 0 80px; }
  .ag-hero h1 { font-size: 36px; line-height: 1.08; }
  .ag-hero-lead { font-size: 17px; }
  .ag-hero-cta { flex-direction: column; }
  .ag-hero-cta .hp-btn { width: 100%; height: 48px; font-size: 16px; }
  .ag-hero-meta { flex-direction: column; gap: 12px; margin-top: 21px; }

  .ag-visual { padding: 16px 16px 72px; border-radius: 20px; }
  .ag-chat-head { flex-wrap: wrap; padding: 16px; }
  .ag-chat-channels { margin-left: 0; width: 100%; }
  .ag-chat-body { padding: 16px; }
  .agents .ag-msg { max-width: 88%; font-size: 14px; line-height: 20.3px; }
  .ag-workorder { left: 16px; right: 16px; width: auto; bottom: -29px; }

  .ag-how-card { padding: 26px 22px; }
  .ag-how-card h3 { font-size: 20px; }

  .ag-list-head p { font-size: 16px; }
  .ag-agent-copy { grid-template-columns: 1fr; }
  .ag-agent-stat { padding: 27px 0 22px; }
  .ag-agent-stat strong { font-size: 34px; line-height: 35.7px; }
  .ag-agent::before { left: -12px; right: -12px; }
  .ag-agent::after { left: -12px; }

  /* Final CTA (shared hp-cta) at the mobile sizes used across the redesign */
  .agents .hp-cta-copy p { font-size: 20px; }
  .agents .hp-cta-btns .hp-btn { height: 48px; font-size: 16px; }
}
