/* ============================================================
   SL Topic-Aligned CTA · Shared shell · 2026-04-29
   Mirrors framework-beats.css so all CTAs match the
   existing Thinking Framework explainer design language.
   ============================================================ */

:root {
  --ink: #0a0b0d;
  --ink-700: #1f2c3d;
  --ink-500: #4a5058;
  --ink-400: #8a919b;
  --ink-200: #e7e9ed;
  --paper: #f6f5f1;
  --paper-card: #fdfcf8;
  --paper-200: #efeeea;
  --teal: #128770;
  --teal-dark: #0a6e5b;
  --teal-bright: #0fb5a6;
  --blue: #3098da;
  --yellow: #f1c206;
  --orange: #d35400;
  --orange-soft: #f76b1c;
  --red: #e74c3c;

  /* Topic accent — set per CTA on the .cta-shell element */
  --topic-accent: var(--teal);
  --topic-accent-dark: var(--teal-dark);
  --topic-accent-soft: rgba(18, 135, 112, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mono {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ----- Shell ------------------------------------------------ */

.cta-shell {
  width: 100%;
  max-width: 980px;
  background: var(--paper-card);
  border: 1px solid var(--ink-200);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(10, 11, 13, 0.04), 0 24px 48px -28px rgba(10, 11, 13, 0.22);
}

/* Header strip — colour driven by topic accent */
.cta-strip {
  background: var(--topic-accent);
  color: #fdfcf8;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cta-strip-icon {
  width: 36px;
  height: 36px;
  background: rgba(253, 252, 248, 0.14);
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cta-strip-icon img,
.cta-strip-icon svg {
  width: 22px;
  height: 22px;
  /* Brand icon is filled in topic-accent — invert to paper-white on the strip */
  filter: brightness(0) invert(1);
}

.cta-strip-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cta-strip-pill {
  background: rgba(253, 252, 248, 0.18);
  color: #fdfcf8;
  padding: 6px 11px;
  border-radius: 100px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ----- Body ------------------------------------------------- */

.cta-body {
  padding: 28px 28px 14px;
}

.cta-headline {
  margin: 0 0 6px;
  color: var(--ink-700);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.cta-sub {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--ink-500);
  font-size: 14px;
  line-height: 1.5;
}

/* ----- Input row ------------------------------------------- */

.cta-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  transition: border-color 200ms, box-shadow 200ms;
  position: relative;
}

/* Idle "type here" pulse — invites interaction.
   Stops on focus or after the user starts typing. */
.cta-input-row.idle {
  animation: cta-invite 3.6s ease-in-out infinite;
}

@keyframes cta-invite {
  0%, 65%, 100% {
    border-color: var(--ink-200);
    box-shadow: 0 0 0 0 var(--topic-accent-soft);
  }
  30% {
    border-color: var(--topic-accent);
    box-shadow: 0 0 0 5px var(--topic-accent-soft);
  }
}

.cta-input-row:focus-within {
  border-color: var(--topic-accent);
  box-shadow: 0 0 0 3px var(--topic-accent-soft);
  animation: none;
}

/* The typing demo + breathing border-pulse already signal live.
   No floating "Type here" hint needed — three live signals is too noisy. */

.cta-input-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  white-space: nowrap;
}

.cta-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 0;
  min-width: 0;
}

.cta-input::placeholder { color: var(--ink-400); font-style: italic; }

/* When the demo overlay is active, hide the input's own placeholder
   so we don't get two layers of ghost text on top of each other. */
.cta-input-row.has-demo .cta-input::placeholder { color: transparent; }

/* Wrapper around the input so we can absolutely position the demo
   overlay within the input's exact rendering area. */
.cta-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.cta-input-wrap .cta-input {
  width: 100%;
  position: relative;
  z-index: 2;
  background: transparent;
}

/* Typing-demo overlay — rotates through example topics so it's obvious
   the input is live. Sits behind the real input value (z-index 1). */
.cta-input-demo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-500);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  z-index: 1;
}

.cta-input-demo .demo-caret {
  display: inline-block;
  width: 1.5px;
  height: 16px;
  background: var(--topic-accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: demo-caret-blink 1s steps(2) infinite;
}

@keyframes demo-caret-blink {
  50% { opacity: 0; }
}

@media (max-width: 540px) {
  .cta-input-demo { font-size: 14px; }
}

/* Generate button — uses both .cta-go and #cta-go for selector safety */
.cta-go,
#cta-go {
  background: var(--topic-accent);
  color: #fdfcf8;
  border: none;
  padding: 11px 18px;
  border-radius: 9px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 160ms cubic-bezier(0.2,0.9,0.3,1.2), box-shadow 200ms, background 160ms;
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
}

.cta-go::after,
#cta-go::after {
  content: "→";
  font-size: 13px;
  line-height: 1;
  transition: transform 200ms cubic-bezier(0.2,0.9,0.3,1.2);
}

.cta-go:hover,
#cta-go:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.22);
}

.cta-go:hover::after,
#cta-go:hover::after { transform: translateX(2px); }

.cta-go:active,
#cta-go:active { transform: translateY(0); }

/* ----- Question stack ------------------------------------- */

.cta-stack {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.cta-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 360ms ease-out, transform 480ms cubic-bezier(0.2,0.9,0.3,1.2);
}

.cta-row.in {
  opacity: 1;
  transform: translateY(0);
}

.cta-row[data-i="0"].in { transition-delay: 0ms; }
.cta-row[data-i="1"].in { transition-delay: 110ms; }
.cta-row[data-i="2"].in { transition-delay: 220ms; }
.cta-row[data-i="3"].in { transition-delay: 330ms; }

.cta-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--paper-card);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  box-shadow: 0 6px 16px -14px rgba(10, 11, 13, 0.4);
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-700);
}

/* Thinking Framework taxonomy bands.
   Generate Questions = Green (Know It / metacognitive question-posing)
   Compare           = Blue  (Map It / organising structure)
   Validate          = Yellow (precision & evidence)
   Infer             = Red   (Higher Order)
   Order matches the Oracy stack used in 01-questioning-general.html. */
.cta-card[data-c="0"] { border-top: 3px solid var(--teal); }    /* Green / Know It */
.cta-card[data-c="1"] { border-top: 3px solid var(--blue); }    /* Map It */
.cta-card[data-c="2"] { border-top: 3px solid var(--yellow); }  /* Define It / precision */
.cta-card[data-c="3"] { border-top: 3px solid var(--red); }     /* Higher Order */

.cta-card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.cta-prompt {
  min-height: 48px;
  padding: 10px 13px;
  background: rgba(253, 252, 248, 0.94);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  box-shadow: 0 8px 16px -16px rgba(10, 11, 13, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cta-prompt-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 2px;
}

.cta-prompt-text {
  color: var(--ink-700);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.32;
}

/* Empty-state preview (before user types) */
.cta-stack.empty .cta-row { opacity: 0.55; }
.cta-stack.empty .cta-prompt-text { color: var(--ink-400); font-style: italic; }

/* ----- Caption (long-tail keywords + research anchor) ---- */

.cta-caption {
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed rgba(10, 11, 13, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cta-caption-tags {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  line-height: 1.5;
}

.cta-caption-tags .dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 8px;
  opacity: 0.5;
  vertical-align: middle;
}

.cta-caption-research {
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-500);
  line-height: 1.45;
}

.cta-caption-research strong {
  color: var(--ink-700);
  font-weight: 600;
  font-style: normal;
}

/* ----- Footer ---------------------------------------------- */

.cta-footer {
  margin-top: 4px;
  padding: 18px 28px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(10, 11, 13, 0.06);
  background: var(--paper);
}

.cta-stats {
  display: flex;
  gap: 22px;
}

.cta-stat-num {
  font-family: 'Geist', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--topic-accent);
  line-height: 1;
}

.cta-stat-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10, 11, 13, 0.55);
  margin-top: 4px;
}

.cta-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.cta-primary {
  background: var(--topic-accent);
  color: #fdfcf8;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 160ms cubic-bezier(0.2,0.9,0.3,1.2), box-shadow 200ms;
}

.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.25);
}

.cta-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(10, 11, 13, 0.18);
  padding: 12px 18px;
  border-radius: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms, color 160ms;
}

.cta-secondary:hover {
  border-color: var(--topic-accent);
  color: var(--topic-accent);
}

/* ----- Responsive ----------------------------------------- */

@media (max-width: 720px) {
  .cta-headline { font-size: 22px; }
  .cta-body { padding: 22px 20px 12px; }
  .cta-footer { padding: 14px 20px 18px; }
  .cta-row { grid-template-columns: 1fr; gap: 8px; }
  .cta-card { width: max-content; }
  .cta-actions { width: 100%; }
  .cta-primary, .cta-secondary { flex: 1; justify-content: center; text-align: center; }
  .cta-stats { width: 100%; justify-content: space-between; gap: 12px; order: 2; }
  .cta-actions { order: 1; }
}

@media (max-width: 560px) {
  /* Below ~560px the Topic / Input / Generate row gets cramped.
     Stack vertically: input on its own row, Generate button below full-width. */
  .cta-input-row {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }
  .cta-input-label {
    width: 100%;
    margin-bottom: -2px;
  }
  .cta-input-wrap { width: 100%; flex-basis: 100%; }
  .cta-go,
  #cta-go {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }
  .cta-go::after,
  #cta-go::after { margin-left: auto; }
  .cta-strip { padding: 12px 14px; gap: 12px; }
  .cta-strip-pill { display: none; }
}

@media (max-width: 480px) {
  .cta-headline { font-size: 20px; }
  .cta-stat-num { font-size: 16px; }
  .cta-strip-eyebrow { font-size: 10px; letter-spacing: 0.08em; }
  .cta-caption-tags { font-size: 9.5px; }
}

/* ----- Reduced motion ------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
