/* ============================================================
   BRAND ANALYSER — "Try it on your brand" lead capture.
   Hero teaser input + full analyser section. Flat maroon,
   square data cards, pill actions, mono system text.
   ============================================================ */

/* ---- hero teaser ------------------------------------------ */
.hero-try { display: flex; align-items: stretch; gap: 0; margin-top: 18px; max-width: 430px; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(246,239,224,.06); overflow: hidden; transition: border-color .16s var(--ease); }
.hero-try:focus-within { border-color: rgba(255,122,233,.55); }
.hero-try input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cream); font-family: var(--f-data); font-size: 13px; padding: 13px 8px 13px 20px; outline: none; }
.hero-try input::placeholder { color: var(--cream-4); }
.hero-try button { flex-shrink: 0; display: flex; align-items: center; gap: 7px; border: 0; cursor: pointer; margin: 4px; padding: 0 18px; border-radius: 999px; background: var(--yellow); color: #240016; font-family: var(--f-sans); font-weight: 700; font-size: 13px; transition: filter .16s var(--ease); }
.hero-try button:hover { filter: brightness(1.06); }
.hero-try button svg { width: 13px; height: 13px; }
.hero-try-fine { display: block; margin-top: 9px; font-family: var(--f-label); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--cream-4); }

/* teaser inline flow — gate prompt / loader status / errors */
.ana-teaser-note { display: block; margin-top: 10px; font-family: var(--f-text); font-size: 13px; line-height: 1.5; color: var(--cream-2); max-width: 430px; }
.ana-teaser-note.err { color: #ffb3a0; }
.ana-catcher .ana-teaser-note { flex-basis: 100%; text-align: center; margin-top: 0; max-width: none; }
.cta .ana-teaser-note { position: relative; z-index: 2; margin: 12px auto 0; text-align: center; }
/* running: the pill fills left to right with the --fill percentage the
   loader sets each frame, and the input shows the current step */
.hero-try.is-running { border-color: rgba(255,122,233,.4); background-image: linear-gradient(90deg, rgba(255,122,233,.22) var(--fill, 0%), transparent var(--fill, 0%)); }
.hero-try.is-running input { color: var(--cream); font-family: var(--f-text); text-overflow: ellipsis; cursor: default; }
.hero-try.is-running button { filter: none; cursor: default; animation: ana-teaser-breathe 1.6s ease-in-out infinite; }
@keyframes ana-teaser-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .hero-try.is-running button { animation: none; } }

/* ---- section shell ---------------------------------------- */
.ana-shell { max-width: 1080px; margin: 44px auto 0; }

/* ---- form state ------------------------------------------- */
.ana-form { max-width: 760px; margin: 0 auto; }
.ana-fields { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; max-width: 560px; margin: 0 auto; }
.ana-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.af-l { font-family: var(--f-label); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-3); }
.ana-field input { width: 100%; box-sizing: border-box; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(246,239,224,.06); color: var(--cream); font-family: var(--f-text); font-size: 14px; padding: 13px 20px; outline: none; transition: border-color .16s var(--ease); }
.ana-field input::placeholder { color: var(--cream-4); }
.ana-field input:focus { border-color: rgba(255,122,233,.55); }
/* running: the website field is the progress indicator, filling left to right */
[data-ana][data-state="running"] .ana-field input { border-color: rgba(255,122,233,.4); background-image: linear-gradient(90deg, rgba(255,122,233,.22) var(--fill, 0%), transparent var(--fill, 0%)); text-overflow: ellipsis; cursor: default; }
[data-ana][data-state="running"] .af-l { color: var(--pink); }
[data-ana][data-state="running"] .ana-go { opacity: .6; cursor: default; }
[data-ana][data-state="running"] .ana-fine { visibility: hidden; }
.ana-go { white-space: nowrap; }
.ana-fine { text-align: center; font-family: var(--f-label); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--cream-4); margin: 16px 0 0; }
.ana-err { text-align: center; font-size: 13px; color: #ffb3a0; margin: 12px 0 0; }

/* ---- loader state: the form stays up; see the running rules above ---- */
.ana-loader { display: none; }
.ana-status { font-family: var(--f-label); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- results state ----------------------------------------- */
.ana-rhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--hair); padding-bottom: 14px; }
.ana-rid { font-family: var(--f-label); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-3); }
.ana-rid b { color: var(--cream); font-weight: 500; }
.ana-rnote { font-family: var(--f-label); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-4); }
.ana-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 18px; }
.ana-card { background: var(--page-panel); border: 1px solid var(--hair); padding: 24px 24px 26px; min-width: 0; }
.ac-eyb { font-family: var(--f-label); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); margin: 0 0 16px; }
.ac-sum { font-family: var(--f-display); font-size: 19px; line-height: 1.3; letter-spacing: -.01em; color: var(--cream); margin: 0 0 20px; text-wrap: pretty; }

/* voice pillars */
.ana-pillars { display: flex; flex-direction: column; gap: 17px; }
.apx-labels { display: flex; justify-content: space-between; font-family: var(--f-label); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-2); margin-bottom: 7px; }
.apx-track { position: relative; height: 4px; border-radius: 999px; background: rgba(246,239,224,.14); }
.apx-dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: var(--pink); transform: translate(-50%,-50%); transition: left .8s var(--ease); box-shadow: 0 0 10px -1px rgba(255,122,233,.6); }
.apx-note { font-size: 12px; color: var(--cream-3); margin: 7px 0 0; }

/* AI visibility */
.ana-score { display: flex; align-items: baseline; gap: 5px; margin: -4px 0 14px; }
.as-n { font-family: var(--f-sans); font-weight: 300; font-size: 62px; line-height: 1; letter-spacing: -.03em; color: var(--cream); font-variant-numeric: tabular-nums; }
.as-d { font-family: var(--f-data); font-size: 12px; color: var(--cream-4); }
.ana-card .ac-sub { font-size: 13.5px; line-height: 1.55; color: var(--cream-2); margin: 0 0 16px; }
.ana-finds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ana-finds li { font-size: 12.5px; line-height: 1.5; color: var(--cream-2); padding-left: 17px; position: relative; }
.ana-finds li::before { content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }

/* subject lines */
.al-lab { font-family: var(--f-label); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-4); margin: 16px 0 8px; }
.al-lab:first-of-type { margin-top: 0; }
.ana-subjects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ana-subjects li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.asub { font-size: 14px; line-height: 1.65; color: var(--cream); min-width: 0; }
.asub-u { flex-shrink: 0; font-family: var(--f-data); font-size: 10px; letter-spacing: .06em; color: var(--ok, #4ade94); border: 1px solid rgba(74,222,148,.35); border-radius: 999px; padding: 3px 9px; margin-top: 3px; white-space: nowrap; }

/* results footer */
.ana-foot { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; }
.ana-again { border: 0; background: none; cursor: pointer; font-family: var(--f-label); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-3); text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.ana-again:hover { color: var(--cream); }

/* ---- email gate -------------------------------------------- */
.ana-gate { max-width: 520px; margin: 0 auto; padding: 40px 20px 24px; text-align: center; animation: ana-in .5s var(--ease); }
.ag-eyb { font-family: var(--f-label); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); margin: 0 0 14px; }
.ag-head { font-family: var(--f-display); font-size: 30px; line-height: 1.12; letter-spacing: -.02em; color: var(--cream); margin: 0 0 10px; text-wrap: pretty; }
.ag-head b { font-weight: inherit; color: var(--pink); }
.ag-sub { font-size: 14px; line-height: 1.55; color: var(--cream-2); margin: 0 0 22px; }
.ana-gateform { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(246,239,224,.06); overflow: hidden; transition: border-color .16s var(--ease); }
.ana-gateform:focus-within { border-color: rgba(255,122,233,.55); }
.ana-gateform input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cream); font-family: var(--f-text); font-size: 14px; padding: 13px 8px 13px 20px; outline: none; }
.ana-gateform input::placeholder { color: var(--cream-3); }
.ana-gateform button { flex-shrink: 0; border: 0; cursor: pointer; margin: 4px; padding: 0 20px; border-radius: 999px; background: var(--yellow); color: #15020c; font-family: var(--f-sans); font-weight: 600; font-size: 13px; transition: filter .16s var(--ease); }
.ana-gateform button:hover { filter: brightness(1.06); }
.ag-reassure { font-size: 13px; color: var(--cream-3); margin: 14px 0 0; }

/* state switching */
[data-ana][data-state="idle"] .ana-loader,
[data-ana][data-state="idle"] .ana-gate,
[data-ana][data-state="idle"] .ana-results { display: none; }
[data-ana][data-state="running"] .ana-loader,
[data-ana][data-state="running"] .ana-gate,
[data-ana][data-state="running"] .ana-results { display: none; }
[data-ana][data-state="gate"] .ana-form,
[data-ana][data-state="gate"] .ana-loader,
[data-ana][data-state="gate"] .ana-results { display: none; }
[data-ana][data-state="done"] .ana-form,
[data-ana][data-state="done"] .ana-loader,
[data-ana][data-state="done"] .ana-gate { display: none; }
.ana-results { animation: ana-in .5s var(--ease); }
@keyframes ana-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ana-results { animation: none; } }

/* ---- "in the platform" demo -------------------------------- */
.ana-demo { margin-top: 26px; }
.ad-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ana-win { max-width: none; }
.ad-body { background: var(--maroon-deep); }
.ad-brief { display: flex; align-items: baseline; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--hair); }
.ad-brief-l {
  flex: none; font-family: var(--f-label); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cream); background: var(--maroon-500);
  border-radius: 999px; padding: 3px 10px; transform: translateY(-1px);
}
.ad-brief-t { font-family: var(--f-display); font-size: 17.5px; line-height: 1.35; letter-spacing: -.01em; color: var(--cream); }
.ad-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 11px 22px; border-bottom: 1px solid var(--hair);
  font-family: var(--f-label); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cream-3);
}
.ad-voice b { color: var(--pink); font-weight: 500; }
.ad-gen { display: inline-flex; align-items: center; gap: 7px; }
.ad-tabs { display: flex; gap: 2px; padding: 16px 22px 0; }
.ad-tab {
  border: 1px solid var(--hair); border-bottom: 0; background: transparent; cursor: pointer;
  font-family: var(--f-label); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cream-3);
  padding: 8px 16px; border-radius: 8px 8px 0 0;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.ad-tab:hover { color: var(--cream); }
.ad-tab.on { background: var(--page-panel); color: var(--cream); }
/* brand logo (fetched client-side; falls back to letter avatars) */
.ana-logoslot { display: inline-flex; vertical-align: middle; margin-right: 7px; }
.ana-logo {
  height: 16px; width: auto; max-width: 72px; display: block;
  background: var(--cream); border-radius: 4px; padding: 1px 3px;
}
.ax-av.has-logo { background: var(--cream); border: 0; padding: 2px; }
.ax-avimg { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 3px; }

/* brand colour accent — set from the logo when CORS-readable */
.ana-demo { --brandc: var(--pink); }
.ana-demo .ax-ctxchip { color: var(--brandc); border-color: var(--brandc); opacity: 0.92; }
.ana-demo .ad-voice b { color: var(--brandc); }

/* the audience grid — nine guests, one send */
.ax-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0 22px; padding: 16px 0; border-top: 1px solid var(--hair);
}
.ax-tile {
  background: var(--page-panel); border: 1px solid var(--hair);
  border-radius: 10px; overflow: hidden; min-width: 0;
  transition: opacity .3s var(--ease);
}
.ax-tile.is-drop { opacity: .42; }
.ax-tile.is-drop .ax-subj { text-decoration: line-through; }
.ax-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-bottom: 1px solid var(--hair);
}
.ax-bar i { width: 5px; height: 5px; border-radius: 50%; background: rgba(246,239,224,0.16); }
.ax-bar span {
  flex: 1; text-align: center; font-family: var(--f-label);
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-4);
  padding-right: 23px; /* balance the traffic dots */
}
.ax-mail { padding: 10px 12px 12px; }
.ax-ctxchip {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--f-label); font-size: 8.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--pink);
  border: 1px dashed rgba(255,122,233,0.45); border-radius: 999px;
  padding: 2px 8px; margin-bottom: 8px;
}
.ax-sender { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ax-av {
  flex: none; width: 18px; height: 18px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--maroon-500); color: var(--cream);
  font-family: var(--f-sans); font-weight: 700; font-size: 9.5px;
}
.ax-from {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--f-sans); font-weight: 600; font-size: 11.5px; color: var(--cream-2);
}
.ax-time { flex: none; font-family: var(--f-data); font-size: 9px; color: var(--cream-4); }
.ax-st {
  flex: none; font-family: var(--f-label); font-size: 8.5px; letter-spacing: .08em;
  text-transform: uppercase; border-radius: 999px; padding: 2px 8px;
}
.ax-st.win { color: var(--ok, #2eb886); background: rgba(46,184,134,0.14); border: 1px solid rgba(46,184,134,0.35); }
.ax-st.test { color: var(--cream-3); border: 1px solid var(--hair-2); }
.ax-st.drop { color: var(--cream-4); border: 1px solid var(--hair); }
.ax-subj { font-size: 12.5px; line-height: 1.45; color: var(--cream); margin-top: 8px; }
.ax-pre {
  font-size: 11px; color: var(--cream-4); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-behind {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 0 22px; padding: 12px 0 16px; border-top: 1px solid var(--hair);
}
.axb-l {
  flex: none; font-family: var(--f-label); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cream-4);
}
.axb-t { font-size: 12.5px; line-height: 1.5; color: var(--cream-3); }
.ad-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 13px 22px 16px; border-top: 1px solid var(--hair);
}
.ad-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-label); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--cream-3);
}
.ad-check svg { width: 12px; height: 12px; color: var(--ok, #4ade94); flex: none; }
.ad-approve {
  display: inline-flex; align-items: center; text-decoration: none;
  font-family: var(--f-sans); font-weight: 600; font-size: 13px;
  padding: 9px 18px; border-radius: 8px; background: var(--ok, #2eb886); color: #062018;
  transition: filter .16s var(--ease);
}
.ad-approve:hover { filter: brightness(1.08); }

/* ---- responsive -------------------------------------------- */
@media (max-width: 760px) {
  .ax-grid { grid-template-columns: 1fr 1fr; }
  .ax-grid .ax-tile:nth-child(n+7) { display: none; }
  .ad-tabs { flex-wrap: wrap; }
  .ad-tab { border-radius: 8px; border-bottom: 1px solid var(--hair); }
}
@media (max-width: 480px) {
  .ax-grid { grid-template-columns: 1fr; }
  .ax-grid .ax-tile:nth-child(n+5) { display: none; }
}
@media (max-width: 980px) {
  .ana-grid { grid-template-columns: 1fr; }
  .ad-brief { flex-direction: column; gap: 8px; }
  .ana-fields { grid-template-columns: 1fr; }
  .ana-go { width: 100%; }
  .ana-gateform { flex-direction: column; border-radius: 22px; padding: 6px; }
  .ana-gateform input { padding: 12px 16px; text-align: center; }
  .ana-gateform button { margin: 0; padding: 12px 20px; }
}
@media (max-width: 980px) {
  .hero-try { max-width: 100%; }
}
