/* Echo Digital: AI FAQ section, shown on its own.
   The frame around it (logo, title, background) is the echo-reports house style:
   Red Hat Display + Lato on the #eaeef4 ground, the tokens copied from
   echo-reports/_src/build_alders_aug.py. The FAQ section inside keeps its own
   look (Newsreader headings, Lato text); every colour and font it uses is a variable below, so a client version
   is a palette swap, not a rewrite. */

@font-face { font-family: "RHD"; src: url("/fonts/rhd700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "RHD"; src: url("/fonts/rhd800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "LatoR"; src: url("/fonts/lato400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "LatoR"; src: url("/fonts/lato700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Echo frame (echo-reports tokens) */
  --e-ground: #eaeef4;
  --e-ink: #16233a;
  --e-muted: #5f6f86;
  --e-line: #dce2ec;
  --e-shadow: 0 1px 2px rgba(22, 35, 58, 0.05), 0 8px 28px rgba(22, 35, 58, 0.06);

  /* The FAQ section */
  --box: #f1eee7;
  --chip: #faf8f4;
  --ink: #15181a;
  --ink-2: #555b60;
  --ink-3: #8b9095;
  --line: rgba(21, 24, 26, 0.12);
  --accent: #1e4a3d;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "LatoR", "Lato", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --gutter: clamp(20px, 5vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 52px) clamp(14px, 4vw, 40px) calc(64px + env(safe-area-inset-bottom));
  background: var(--e-ground);
  color: var(--e-ink);
  font: 400 16px/1.5 "LatoR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
p { margin: 0; }
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Echo masthead */
.echo-mast { max-width: 1200px; margin: 0 auto 30px; }
.echo-mast__logo { display: block; height: 30px; width: auto; margin-bottom: 26px; }
.echo-mast__title {
  margin: 0;
  font: 800 clamp(26px, 4vw, 36px)/1.06 "RHD", system-ui, sans-serif;
  letter-spacing: -0.01em;
}
.echo-mast__sub { margin-top: 10px; max-width: 64ch; font-size: clamp(15px, 2vw, 17px); line-height: 1.55; color: var(--e-muted); }

/* The section sits on the page like a panel in a report */
.echo-specimen {
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid var(--e-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--e-shadow);
}

/* ------------------------------------------------------------------ */
/* FAQ: same anatomy as the reference. Heading left, questions right,  */
/* and the last row is a question you type yourself.                  */
/* ------------------------------------------------------------------ */
.faq {
  background: var(--box);
  color: var(--ink);
  font: 400 16px/1.55 var(--body); /* its own type, not the Echo frame's */
  text-rendering: optimizeLegibility;
  padding: clamp(56px, 9vw, 112px) var(--gutter);
  touch-action: manipulation;
}
.faq__inner {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(40px, 5vw, 64px);
}
.faq__title {
  margin: 0;
  max-width: 10ch;
  font: 500 clamp(42px, 5.2vw, 60px)/1.04 var(--display);
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
}
.faq__line { display: inline; }
.faq__tail { color: var(--ink-3); }
.faq__lede { margin-top: 16px; max-width: 30ch; font-size: 15px; color: var(--ink-2); }

/* Word reveal. The JS only adds these spans when it is about to animate them,
   so with no JS the heading is plain text and fully visible. */
.faq__title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.faq__title .w > span { display: inline-block; }

.faq__list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.qa + .qa, .qa + .ask { border-top: 1px solid var(--line); }

.qa__summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.qa__summary::-webkit-details-marker { display: none; }
.qa__summary::marker { content: ""; }
.qa__q { font-size: 17px; font-weight: 700; line-height: 1.4; }
.qa__icon {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px; margin-top: -1px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink-2);
  transition: transform 320ms var(--ease), background-color 180ms, color 180ms;
}
.qa__icon svg, .ask__btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.qa.is-open .qa__icon { transform: rotate(45deg); color: var(--ink); }
.qa__a { overflow: hidden; }
.qa__a p { max-width: 62ch; padding: 0 52px 22px 0; margin-top: -6px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }

/* The ask row */
.ask { padding: 16px 0; }
.ask__form { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.ask__input {
  flex: 1; min-width: 0;
  margin: 0 -10px; padding: 6px 10px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 700 17px/1.4 var(--body); /* 17px also stops iOS zooming on focus */
  display: block;
  resize: none;
  overflow: hidden; /* grows with the question instead of scrolling */
  -webkit-appearance: none; appearance: none;
  outline: none;
  box-shadow: 0 0 0 1.5px transparent;
  transition: box-shadow 180ms, background-color 180ms;
}
.ask__input::placeholder { color: var(--ink-3); font-weight: 400; opacity: 1; }
.ask__input:focus { background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1.5px var(--accent); }

.ask__btn {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0; margin-top: 4px;
  border: 0; border-radius: 50%;
  background: var(--ink); color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 200ms, color 200ms, transform 150ms var(--ease);
}
.ask__btn::before { content: ""; position: absolute; inset: -8px; } /* 44px touch target */
.ask__btn:disabled { background: var(--chip); color: var(--ink-3); cursor: default; }
.ask__btn:not(:disabled):active { transform: scale(0.9); }
.ask__btn svg { grid-area: 1 / 1; transition: opacity 180ms, transform 220ms var(--ease); }
.ask__stop { fill: currentColor !important; stroke: none !important; width: 13px !important; height: 13px !important; opacity: 0; transform: scale(0.5); }
.ask.is-busy .ask__send { opacity: 0; transform: scale(0.5); }
.ask.is-busy .ask__stop { opacity: 1; transform: none; }

/* Answer area. Its height is driven from JS so it glides as lines arrive. */
.ask__out { height: 0; overflow: hidden; transition: height 280ms var(--ease); }
.ask__body { padding: 12px 52px 8px 0; }
.ask__status { width: fit-content; font-size: 14px; color: var(--ink-3); }
.ask__status.shimmer {
  color: transparent;
  background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%, var(--ink-3) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.ask__answer { max-width: 62ch; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.ask__answer > * + * { margin-top: 10px; }
.ask__answer ul, .ask__answer ol { margin-bottom: 0; padding-left: 20px; }
.ask__answer li + li { margin-top: 4px; }
.ask__answer li::marker { color: var(--ink-3); }
.ask__answer strong { color: var(--ink); font-weight: 700; }
.ask__answer a { color: var(--ink); text-decoration-color: rgba(21, 24, 26, 0.35); text-underline-offset: 3px; }
.ask__answer a:hover { text-decoration-color: currentColor; }
.ask__answer a[href^="tel:"] { white-space: nowrap; } /* never split a phone number */
.fade-in { animation: fade-in 200ms var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }

/* Hover only where there is a real pointer; on phones a tap leaves :hover stuck. */
@media (hover: hover) {
  .qa__summary:hover .qa__icon { background: #fff; color: var(--ink); }
  .ask__input:hover:not(:focus) { background: rgba(255, 255, 255, 0.45); }
}

/* Phone */
@media (max-width: 720px) {
  .faq__inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .faq__title { max-width: none; }
  .faq__lede { max-width: 40ch; }
  .qa__a p, .ask__body { padding-right: 0; }
}
@media (max-width: 520px) {
  .echo-mast__logo { height: 26px; margin-bottom: 20px; }
  .echo-specimen { border-radius: 14px; }
  .qa__summary { gap: 16px; }
  .ask__form { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .ask__status.shimmer { color: var(--ink-3); background: none; }
}
