/* SiteReadable — single stylesheet, no external fonts (performance dogfooding) */
:root {
  --bg: #0b1220;
  --bg-card: #121b2e;
  --bg-soft: #1a2540;
  --text: #e8edf7;
  --muted: #93a0b8;
  --accent: #34d399;
  --accent-2: #22d3ee;
  --good: #34d399;
  --mid: #fbbf24;
  --bad: #f87171;
  --ring-track: #223050;
  --border: #223050;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  line-height: 1.55;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.accent { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #06281c; padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 50; }
.skip-link:focus { left: 0; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--border); background: rgba(11,18,32,.85); position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.logo em { color: var(--accent); font-style: normal; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.site-header nav a:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 28px 0 40px; background: var(--bg-card); }
.site-footer p { margin: .4rem 0; }
.site-footer .footer-cta { font-weight: 600; margin: 1.1rem 0 0; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: .5rem 0 1rem; padding: 0; }
.social-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft);
  color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600;
  font-family: inherit; line-height: 1.55; cursor: pointer;
}
.social-link svg { flex: none; }
.social-link:hover, .social-link:focus-visible { color: var(--text); border-color: var(--accent); }
/* Empty live region: collapses to nothing until the badge is injected */
.site-footer .copy-badge-slot { margin: 0; }
.copy-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: rgba(52, 211, 153, .14); border: 1px solid var(--accent);
  color: var(--accent); font-size: .82rem; font-weight: 600;
  animation: badge-in .18s ease-out;
}
@keyframes badge-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .copy-badge { animation: none; } }

/* Hero */
.hero { text-align: center; padding: 64px 20px 30px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; margin-bottom: 8px; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); max-width: 780px; margin: 0 auto .8rem; }
.hero .sub { color: var(--muted); max-width: 640px; margin: 0 auto 1.6rem; font-size: 1.05rem; }

.audit-form { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 8px; }
.audit-form input {
  flex: 1; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-size: 1rem; min-width: 0;
}
.audit-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.audit-form button, .btn-primary {
  padding: 14px 22px; border-radius: var(--radius); border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06281c; font-weight: 700; font-size: 1rem;
}
.audit-form button:disabled { opacity: .6; cursor: wait; }
.form-error { color: var(--bad); font-weight: 600; max-width: 560px; margin: 10px auto; }

/* Mobile: stack the URL field and the CTA, both full width */
@media (max-width: 620px) {
  .hero { padding: 40px 16px 24px; }
  .audit-form { flex-direction: column; gap: 12px; }
  .audit-form input, .audit-form button { width: 100%; }
  .audit-form button { padding: 16px 22px; }
}

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.progress-card { display: flex; gap: 16px; align-items: center; }
.progress-title { font-weight: 600; margin: 0; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--ring-track); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Overall */
.overall-card { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.overall-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: .9rem; }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: none; color: var(--muted); border: 0; cursor: pointer; font-size: .9rem; text-decoration: underline; }

/* Rings */
.ring { position: relative; width: var(--size); height: var(--size); display: inline-flex; align-items: center; justify-content: center; flex-direction: column; }
.ring svg { position: absolute; inset: 0; }
.ring-value { font-weight: 800; font-size: calc(var(--size) * 0.28); }
.ring-label { font-size: calc(var(--size) * 0.105); color: var(--muted); max-width: 90%; text-align: center; }
.ring-na .ring-value { color: var(--muted); }
.mini-rings { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* Checks */
details { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 6px; }
details summary { cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; list-style: none; padding: 8px 0; }
details summary::-webkit-details-marker { display: none; }
details summary h3 { margin: 0; font-size: 1.02rem; }
details summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details[open] summary::after { transform: rotate(180deg); }
.section-note { margin: 4px 0 8px; }
.check-list { list-style: none; padding: 0; margin: 8px 0 4px; display: grid; gap: 10px; }
.check { display: flex; gap: 12px; background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; }
.check-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; margin-top: 2px; }
.check-pass .check-icon { background: rgba(52,211,153,.15); color: var(--good); }
.check-warn .check-icon { background: rgba(251,191,36,.15); color: var(--mid); }
.check-fail .check-icon { background: rgba(248,113,113,.15); color: var(--bad); }
.check-error .check-icon { background: rgba(147,160,184,.15); color: var(--muted); }
.check-info .check-icon { background: rgba(34,211,238,.12); color: var(--accent-2); }
.check-label { font-weight: 600; margin: 0; }
.check-detail { margin: 2px 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.check-fix { margin: 6px 0 0; font-size: .9rem; color: var(--text); background: rgba(52,211,153,.07); border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 6px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-pass { background: rgba(52,211,153,.15); color: var(--good); }
.badge-warn { background: rgba(251,191,36,.15); color: var(--mid); }
.badge-fail { background: rgba(248,113,113,.15); color: var(--bad); }
.badge-error { background: rgba(147,160,184,.2); color: var(--muted); }
.badge-accent { background: rgba(34,211,238,.15); color: var(--accent-2); }
.sum-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* AI section */
.ai-card { border: 1px solid rgba(52,211,153,.4); box-shadow: 0 0 40px rgba(52,211,153,.06); }
.ai-head { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.ai-head > div:last-child { flex: 1; min-width: 260px; }
.ai-breakdown { margin-top: 10px; display: grid; gap: 6px; }
.ai-bar-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr 46px; gap: 10px; align-items: center; font-size: .85rem; }
.ai-bar { background: var(--ring-track); height: 8px; border-radius: 6px; overflow: hidden; }
.ai-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; }
.ai-bar-pts { color: var(--muted); text-align: right; }

/* PSI */
.psi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .psi-grid { grid-template-columns: 1fr; } .ai-bar-row { grid-template-columns: 1fr 1fr 40px; } }
.cwv-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.cwv { padding: 4px 10px; border-radius: 8px; font-size: .85rem; background: var(--bg-soft); }
.cwv-good { border: 1px solid var(--good); }
.cwv-mid { border: 1px solid var(--mid); }
.cwv-bad { border: 1px solid var(--bad); }
.opps { padding-left: 20px; display: grid; gap: 8px; }
.opps-title { margin-top: 18px; }
.fail-text { color: var(--bad); }
.pass-text { color: var(--good); font-weight: 600; }

/* Email card */
.email-card { border: 1px dashed var(--accent-2); }
.lead-form { display: flex; gap: 10px; max-width: 480px; margin: 10px 0; flex-wrap: wrap; }
.lead-form input { flex: 1; min-width: 220px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); }
.lead-form button { padding: 12px 18px; border-radius: 10px; border: 0; background: var(--accent-2); color: #06281c; font-weight: 700; cursor: pointer; }

.disclaimer-inline { margin: 26px 0 6px; }

/* Print = the PDF report */
@media print {
  :root { --bg: #fff; --bg-card: #fff; --bg-soft: #f4f6fa; --text: #111827; --muted: #4b5563; --border: #d1d5db; --ring-track: #e5e7eb; }
  body { background: #fff; color: #111827; }
  .site-header nav, .audit-form, .hero .sub, .eyebrow, .overall-actions, .email-card form, .email-card h3, .email-card > p,
  #progress, .btn-secondary, .btn-ghost, #pdf-ready button, .retry-psi { display: none !important; }
  .hero { padding: 10px 0 0; }
  .hero h1 { font-size: 1.4rem; }
  .card { border: 1px solid #d1d5db; break-inside: avoid; margin: 10px 0; }
  details { display: block; }
  details summary::after { display: none; }
  .site-footer { margin-top: 20px; }
  a { color: #111827; text-decoration: none; }
  #email-card { border: 0; }
  #copy-email::after { content: " — " attr(data-email); }  /* the button does nothing on paper */
  #pdf-ready { display: none !important; }
}
