/*
 * Mobile first, and literally so: the reader is a contractor on a phone, opening
 * a link from an email, probably between jobs. The first screen has to carry the
 * number, the problem and the next step without a scroll — everything else is
 * below and quieter.
 *
 * No framework, no webfont, no build step. The page is static on S3 behind
 * CloudFront and should paint before the API answers.
 */

:root {
  --ink: #14181d;
  --muted: #5b6672;
  --line: #e3e7ec;
  --bg: #ffffff;
  --raise: #f7f9fb;
  --accent: #0f5d4c;
  --accent-ink: #ffffff;
  --poor: #b3341a;
  --fair: #a5661a;
  --good: #17795f;
  --max: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9edf1;
    --muted: #9aa5b1;
    --line: #2a313a;
    --bg: #12161a;
    --raise: #181d23;
    --accent: #2fae90;
    --accent-ink: #05201a;
    --poor: #f08a6e;
    --fair: #e0aa63;
    --good: #58c3a9;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem 3rem; }

.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; margin-top: 2rem; }
.foot a { color: var(--muted); }

h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
h2 { font-size: 1.0625rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.9375rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }

.lede { color: var(--muted); font-size: 1.0625rem; }
.fine { color: var(--muted); font-size: 0.875rem; }
.muted { color: var(--muted); }

/* ── The first screen ─────────────────────────────────────────────────────── */

.eyebrow {
  color: var(--muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0.25rem;
}
.biz-name { font-size: 1.375rem; margin-bottom: 1.25rem; }

.scorecard {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

/* One number, large enough to read at arm's length and to survive a screenshot
   scaled down in a chat thread. */
.score-ring {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.score-value { font-size: 3.75rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.score-max { font-size: 1.25rem; font-weight: 600; color: var(--muted); }

/* Bands rather than a gradient: the reader needs to know in a second whether
   there is a problem, and three colours answer that where a scale does not. */
.score-ring.poor .score-value { color: var(--poor); }
.score-ring.fair .score-value { color: var(--fair); }
.score-ring.good .score-value { color: var(--good); }

.score-label { margin: 0.5rem 0 0; font-weight: 600; text-wrap: balance; }
/* Centred copy left to wrap on its own strands a word on the last line. balance
   is ignored by older engines, which fall back to the current wrap. */
.benchmark { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.9375rem; text-wrap: balance; }

/* ── The second measurement, in the same card ─────────────────────────────── */

/* Its own rule and its own label. Sharing a card puts both on the first screen;
   sharing a number would imply a causal link that is not established. */
.verdict {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.verdict-ring { font-variant-numeric: tabular-nums; }

/* Smaller than the GEO score on purpose: the two are read together, and equal
   weight would invite adding them. */
.verdict-value { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.verdict-ring.poor .verdict-value { color: var(--poor); }
.verdict-ring.good .verdict-value { color: var(--good); }

.verdict-label { margin: 0.4rem 0 0; font-weight: 600; text-wrap: balance; }
.verdict-note { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.9375rem; text-wrap: balance; }
.verdict-waiting { margin: 0; color: var(--muted); }

.fixes { margin-bottom: 1.25rem; }
.gaps { list-style: none; margin: 0; padding: 0; }
.gaps li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.25rem 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.gaps li:last-child { border-bottom: 0; }
.gap-mark::before { content: "\00d7"; color: var(--poor); font-weight: 700; font-size: 1.125rem; }
/* Same list, inverted meaning: on the offer page these are what you get. */
.gap-mark.ok::before { content: "\2713"; color: var(--good); }
.gap-label { font-weight: 600; }
.gap-detail { grid-column: 2; color: var(--muted); font-size: 0.875rem; }

/* States the mechanism, sits directly above the button. Deliberately plain: it
   is the sentence that has to stay true, not the one that has to sell. */
.bridge {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* The one action on the page. Full width because a thumb is not a mouse. */
.cta {
  display: block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
  margin-bottom: 2.5rem;
}
.cta-main { display: block; font-size: 1.0625rem; font-weight: 700; }
.cta-sub { display: block; font-size: 0.8125rem; opacity: 0.85; margin-top: 0.2rem; text-wrap: balance; }

/* Appears only after the real button has scrolled off the top. Sits above the
   home indicator, not under it. */
.sticky-cta {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
  text-align: center;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  animation: rise 0.18s ease-out;
}
.sticky-cta[hidden] { display: none; }
@keyframes rise { from { transform: translateY(120%); } }
@media (prefers-reduced-motion: reduce) {
  .sticky-cta { animation: none; }
}

/* Room for the bar so it never covers the last line of the page. */
main#report { padding-bottom: 6rem; }

@media (min-width: 40rem) {
  .sticky-cta { left: 50%; right: auto; transform: translateX(-50%); width: 22rem; }
  @keyframes rise { from { transform: translate(-50%, 120%); } }
}

/* ── Below the fold ───────────────────────────────────────────────────────── */

/* Quieter on purpose. This half is the hook, but it arrives ~24 seconds late and
   the reader can act on the half above without it. */
.secondary {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}
.secondary h2 { color: var(--muted); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
.engine { margin-bottom: 0.5rem; }

.competitors, .prompts { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.competitors li, .prompts li { margin-bottom: 0.35rem; }
.prompts li { font-style: italic; }

/* ── Marketing page ───────────────────────────────────────────────────────── */

.hero { padding-top: 1rem; }
.request { display: grid; gap: 0.5rem; margin-top: 1.5rem; }
.request label { font-size: 0.875rem; font-weight: 600; }
.request input {
  font: inherit;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.request input:focus-visible, .cta:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button {
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.explainer { margin-top: 2.5rem; }
.request-section { margin-top: 2rem; }
.two { display: grid; gap: 1.25rem; }

.card { border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; margin: 1.25rem auto; max-width: var(--max); }
.error { border-color: var(--poor); color: var(--poor); }

.spinner {
  display: inline-block;
  width: 0.85em; height: 0.85em;
  margin-right: 0.5rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -0.1em;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--line); }
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--raise);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

@media (min-width: 40rem) {
  h1 { font-size: 1.875rem; }
  .biz-name { font-size: 1.75rem; }
  .score-value { font-size: 5rem; }
  .verdict-value { font-size: 2.75rem; }
  .two { grid-template-columns: 1fr 1fr; }
}
