/* Keyword pages (owner, Nov 29, 2026): one page per word in the Home
   keyword band (AEO services, GEO services, AI SEO, LLM SEO, AEO agency, SEO
   agency, AI search, AI visibility, agent readiness, AI brand visibility,
   brand mentions, AI citations, share of voice, prompt tracking). One shared
   template on the Home system: framed hero with the term read
   (term-read.js, the page's own terms), a definition frame, a work frame
   (numbered steps, or example bars from the Monitoring report), the pull
   quote, the FAQ and the closing domain box. Loaded after home.css and
   compare.css. */

/* ---------------------------------------------------------- Definition */
.kw-def .frame-bar span + span { color: var(--muted); }
.kw-def-text { max-width: 36ch; margin: 0; padding: clamp(24px, 4vw, 44px) clamp(20px, 3.5vw, 40px) clamp(20px, 3vw, 32px);
  font: 500 clamp(1.25rem, 2.1vw, 1.75rem)/1.3 var(--display); letter-spacing: -.025em; color: var(--ink); }
.kw-def-rows { margin: 0; border-top: 1px solid var(--rule); }
.kw-def-rows > div { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 6px 24px; padding: 16px clamp(20px, 3.5vw, 40px); }
.kw-def-rows > div + div { border-top: 1px solid var(--rule); }
.kw-def-rows dt { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.kw-def-rows dd { margin: 0; font-size: .9688rem; line-height: 1.5; color: var(--ink); }

/* ----------------------------------------------------------- Work frame */
.kw-work .frame-bar span + span { color: var(--muted); }
.kw-steps { list-style: none; margin: 0; padding: 8px 0; }
.kw-steps li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 18px; padding: 18px clamp(20px, 3.5vw, 40px); }
/* The line that joins the numbers. */
.kw-steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(clamp(20px, 3.5vw, 40px) + 15.5px); top: 52px; bottom: -14px; width: 1px; background: var(--rule-strong); }
.kw-n { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--rule-strong); border-radius: 50%;
  font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--surface); }
.kw-steps b { display: block; font-weight: 500; font-size: 1.0625rem; line-height: 1.35; color: var(--ink); }
.kw-steps p { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.5; }

/* Example bars, from the Monitoring report's example week. */
.kw-bars { list-style: none; margin: 0; padding: 18px 0 22px; }
.kw-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: baseline; padding: 12px clamp(20px, 3.5vw, 40px); }
.kw-bars b { font-weight: 500; color: var(--ink); }
.kw-bars small { display: block; margin-top: 2px; color: var(--muted); font-size: .8125rem; }
.kw-bars .kw-v { font-size: .9375rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kw-meter { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.kw-meter i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: rgba(232, 239, 243, .55); transform-origin: left; }
.kw-bars li.is-you b, .kw-bars li.is-you .kw-v { color: var(--signal); }
.kw-bars li.is-you .kw-meter i { background: var(--signal); }
.kw-bars li.v-sig .kw-meter i { background: var(--signal); }
.kw-bars li.v-ok .kw-meter i { background: var(--pass); }
.kw-bars li.v-part .kw-meter i { background: var(--partial); }
.kw-bars li.v-old .kw-meter i { background: rgba(232, 239, 243, .4); }
.kw-bars li.v-bad .kw-meter i { background: var(--fail); }
.kw-foot { max-width: none; margin: 0; padding: 14px clamp(20px, 3.5vw, 40px); border-top: 1px solid var(--rule); color: var(--muted); font-size: .8125rem; }

/* Motion (library 3 + 6): rows come in one by one when the frame enters
   view; numbers light in Signal in turn; bars grow from the left. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-draw]:is(.kw-def, .kw-work) :is(.kw-def-rows > div, .kw-steps li, .kw-bars li) { opacity: 0; transform: translateY(6px); }
  .js [data-draw]:is(.kw-def, .kw-work) .kw-meter i { transform: scaleX(0); }
  [data-draw].is-in:is(.kw-def, .kw-work) :is(.kw-def-rows > div, .kw-steps li, .kw-bars li) {
    opacity: 1; transform: none; transition: opacity 420ms var(--ease), transform 420ms var(--ease); transition-delay: calc(120ms + var(--i, 0) * 110ms); }
  [data-draw].is-in.kw-work .kw-meter i { transform: none; transition: transform 900ms cubic-bezier(.65, .05, .36, 1) calc(260ms + var(--i, 0) * 110ms); }
  [data-draw].is-in.kw-work .kw-n { animation: kw-lit 600ms var(--ease) calc(300ms + var(--i, 0) * 260ms) forwards; }
}
@keyframes kw-lit { to { color: var(--signal); border-color: var(--signal); } }
@media (prefers-reduced-motion: reduce) { .kw-work .kw-n { color: var(--signal); border-color: var(--signal); } }

/* Narrow frames (phones, and tablets where the frame sits in 8 of 12
   columns): labels sit above their values. */
.kw-def { container: kwdef / inline-size; }
@container kwdef (max-width: 520px) {
  .kw-def-rows > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ------------------------------------------------ Term hero (trial, Nov 29)
   Owner: one shared animation on every keyword page looked repetitive, and
   a definition card beside the H1 said the same thing twice. Trial on
   /share-of-voice: the hero is only the term (large, Ink) and one muted
   line that answers it. No buttons, no date, no picture. Behind it, a dot
   field across the whole hero that shows the page's own subject
   (kw-field.js); dots under the words stay dim. */
.kw-hero { position: relative; overflow: hidden; display: flex; align-items: center;
  min-height: clamp(320px, 42vw, 520px); padding: clamp(56px, 7vw, 96px) var(--inset); }
.kw-field { position: absolute; inset: 0; width: 100%; height: 100%; }
.home .kw-term { position: relative; max-width: 15ch; margin: 0; font-size: clamp(3rem, 7.4vw, 6.25rem); font-weight: 600;
  letter-spacing: -.05em; line-height: .98; }
.kw-term span { display: block; max-width: 30ch; margin-top: clamp(18px, 2.2vw, 28px); color: var(--muted);
  font-size: clamp(1.25rem, 2.1vw, 1.75rem); font-weight: 450; letter-spacing: -.025em; line-height: 1.3; }
@media (prefers-reduced-motion: no-preference) {
  .kw-term span { animation: rv-fade 620ms var(--ease) 280ms backwards; }
}

/* ---------------------------------------------- How one answer is counted
   Section 2 on the term pages (trial, /share-of-voice; owner, Nov 29, 2026:
   the "at a glance" table read badly). One example AI answer: the prompt,
   the answer with each brand it names marked, and a +1 tally per brand.
   On view, the names light one by one (yours in Signal) and each tally row
   lands with its name. */
.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kw-chips li { padding: 2px 9px; border: 1px solid var(--rule); border-radius: 999px; font-size: .75rem; color: var(--muted); }
.kw-chips li.is-on { border-color: rgba(34, 211, 238, .45); color: var(--signal); }
.kw-ans-body { padding: clamp(22px, 3vw, 34px) clamp(20px, 3.5vw, 40px) 8px; }
.kw-q { width: fit-content; max-width: 34ch; margin: 0 0 18px auto; padding: 10px 16px; border-radius: 14px 14px 4px 14px;
  background: rgba(255, 255, 255, .06); font-size: .9688rem; line-height: 1.5; color: var(--ink); }
.kw-a { max-width: 56ch; margin: 0; font-size: 1.0625rem; line-height: 1.7; color: rgba(232, 239, 243, .78); }
.kw-m { -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); color: var(--ink); }
.kw-m--you { background: rgba(34, 211, 238, .14); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .55); color: var(--signal); }
.kw-tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 18px clamp(20px, 3.5vw, 40px) 22px; list-style: none; }
.kw-tally li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; font-size: .875rem; }
.kw-tally b { min-width: 0; font-weight: 500; color: var(--ink); }
.kw-tally span { color: var(--muted); font-variant-numeric: tabular-nums; }
.kw-tally li.is-you { border-color: rgba(34, 211, 238, .45); }
.kw-tally li.is-bad { border-color: rgba(249, 138, 132, .45); }
.kw-tally li.is-bad b, .kw-tally li.is-bad span { color: var(--fail); }
.kw-m--bad { background: rgba(249, 138, 132, .12); box-shadow: inset 0 0 0 1px rgba(249, 138, 132, .5); color: var(--fail); }
.kw-tally li.is-you b, .kw-tally li.is-you span { color: var(--signal); }
.kw-ans { container: kwans / inline-size; }
@container kwans (max-width: 480px) { .kw-tally { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: no-preference) {
  .js [data-draw].kw-ans .kw-m { background: transparent; box-shadow: none; color: inherit; }
  .js [data-draw].kw-ans .kw-tally li { opacity: 0; transform: translateY(6px); }
  [data-draw].is-in.kw-ans .kw-m { animation: kw-mark 420ms var(--ease) calc(300ms + var(--i, 0) * 520ms) backwards; background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); color: var(--ink); }
  [data-draw].is-in.kw-ans .kw-m--you { background: rgba(34, 211, 238, .14); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .55); color: var(--signal); }
  [data-draw].is-in.kw-ans .kw-m--bad { background: rgba(249, 138, 132, .12); box-shadow: inset 0 0 0 1px rgba(249, 138, 132, .5); color: var(--fail); }
  [data-draw].is-in.kw-ans .kw-tally li { opacity: 1; transform: none; transition: opacity 380ms var(--ease), transform 380ms var(--ease); transition-delay: calc(460ms + var(--i, 0) * 520ms); }
}
@keyframes kw-mark { from { background: transparent; box-shadow: none; color: rgba(232, 239, 243, .78); } }

/* City pages: one quiet line under the FAQ naming the other metros we work
   in (owner, Nov 29, 2026: subtle, never a block of "AEO agency in X" links). */
.kw-cities { max-width: 68ch; margin: clamp(28px, 4vw, 40px) 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.6; }

/* Phones (owner, Nov 29, 2026): the keyword and city term steps down from
   48px to 40px, still the largest type on the page. */
@media (max-width: 740px) {
  .home .kw-term { font-size: 2.5rem; }
}
