/* ===========================================================
   AI Readiness — scoped styles (reuses tokens from ../styles.css)
   =========================================================== */

.ar-intro,
.ar-quiz,
.ar-result {
  position: relative;
  z-index: 1;
  width: var(--container);
  margin: 0 auto;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 120px 0 80px;
}

[hidden] { display: none !important; }

/* ── Intro ── */
.ar-intro-copy { width: min(780px, 100%); }
.ar-intro h1 {
  font-size: clamp(40px, 6.6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
}
.ar-lede {
  max-width: 680px;
  color: var(--ink);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.32;
  margin-bottom: 18px;
}
.ar-mirror {
  max-width: 640px;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
  margin-bottom: 36px;
}
.ar-intro .actions { margin-bottom: 22px; }
#ar-start { cursor: pointer; border: none; font-size: 16px; }
.ar-meta {
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Quiz card ── */
.ar-quiz-card {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.05);
}

.ar-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
}
.ar-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--acc);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ar-q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 26px 0 18px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ar-q-counter { color: var(--acc-deep); }
.ar-q-pillar { color: var(--ink-soft); }

.ar-q-text {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.ar-q-help {
  color: var(--ink-soft);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.5;
  margin-bottom: 14px;
}
.ar-q-example {
  margin: 0 0 28px;
  padding: 0;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.7vw, 16px);
  line-height: 1.5;
}
.ar-example-label { display: block; margin-bottom: 2px; color: var(--acc-deep); font-weight: 600; }

.ar-options { display: grid; gap: 12px; }
.ar-options button {
  appearance: none;
  text-align: left;
  cursor: pointer;
  min-height: 60px;
  padding: 0 22px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.ar-options button:hover {
  border-color: var(--acc);
  background: var(--acc-wash);
}
.ar-options button:active { transform: scale(0.99); }
.ar-options button.is-selected {
  border-color: var(--acc);
  background: var(--acc-wash);
}

.ar-back {
  appearance: none;
  margin-top: 26px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease;
}
.ar-back:hover { color: var(--ink); }
.ar-back[disabled] { opacity: 0.3; pointer-events: none; }

/* ── Result ── */
.ar-result-inner { width: min(720px, 100%); margin: 0 auto; }

.ar-score {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 8px 0 22px;
}
.ar-score-num {
  font-family: var(--font-display);
  font-size: clamp(88px, 18vw, 168px);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ar-score-of {
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: clamp(16px, 2.4vw, 22px);
  letter-spacing: 0.02em;
}

.ar-tier-title {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.ar-tier-desc {
  max-width: 600px;
  color: var(--ink-soft);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  margin-bottom: 44px;
}

/* breakdown */
.ar-breakdown { margin-bottom: 44px; }
.ar-breakdown-label {
  color: var(--acc-deep);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.ar-bars { display: grid; gap: 16px; }
.ar-bar-row { display: grid; grid-template-columns: 184px 1fr 44px; gap: 16px; align-items: center; }
.ar-bar-name { display: flex; flex-direction: column; gap: 3px; }
.ar-bar-title { color: var(--ink); font-size: 15px; font-weight: 600; }
.ar-bar-gloss { color: var(--ink-soft); font-size: 12px; line-height: 1.35; }
.ar-bar-track { height: 8px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.ar-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--acc);
  transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ar-bar-val { color: var(--ink-soft); font-family: var(--font-sans); font-size: 13px; text-align: right; }
.ar-weakest { margin-top: 20px; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.ar-weakest strong { color: var(--ink); }

/* data-maturity placement */
.ar-maturity { margin-bottom: 44px; }
.ar-maturity-line { color: var(--ink-soft); font-size: 16px; line-height: 1.5; margin: 0 0 10px; }
.ar-maturity-line strong { color: var(--ink); }

/* print-only branded header (hidden on screen) */
.ar-print-head { display: none; }

/* next steps by area — clean editorial rows, no boxes */
.ar-nextsteps { margin-bottom: 40px; }
.ar-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.ar-step {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4px 28px;
  align-items: baseline;
  padding: 18px 2px;
  border-bottom: 1px solid var(--hairline);
}
.ar-step-area { color: var(--acc-deep); font-size: 15px; font-weight: 600; }
.ar-step-text { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.ar-step-good .ar-step-area { color: var(--ink-faint); }
.ar-step-good .ar-step-text { color: var(--ink-faint); }
.ar-step-good .ar-step-area::before { content: "\2713  "; color: var(--acc-deep); }
.ar-step-allgood {
  padding: 18px 2px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
}
.ar-step-allgood::before { content: "\2713  "; color: var(--acc-deep); }

/* download report (PDF) button — gated by email */
.ar-download { display: inline-flex; margin-top: 18px; cursor: pointer; }
.ar-download[hidden] { display: none; } /* display:inline-flex would otherwise override the hidden attribute */
.ar-download:disabled { opacity: 0.4; cursor: not-allowed; }
.ar-download-hint { margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; }
.ar-download-hint[hidden] { display: none; }

/* offers */
.ar-offer {
  padding: 30px clamp(22px, 4vw, 38px);
  border-radius: 12px;
  margin-bottom: 18px;
}
.ar-offer h3 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.ar-offer p { color: var(--ink-soft); font-size: 17px; line-height: 1.5; margin-bottom: 22px; }

.ar-offer-free {
  border: 1px solid var(--hairline);
  background: var(--card);
}
.ar-offer-paid {
  border: 1px solid var(--hairline-strong);
  background: var(--paper-deep);
}

.ar-form { display: grid; gap: 12px; }
.ar-form input:not([type="hidden"]),
.ar-form select,
.ar-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}
.ar-form input:not([type="hidden"]):focus,
.ar-form select:focus,
.ar-form textarea:focus { outline: none; border-color: var(--acc); }
.ar-form input::placeholder,
.ar-form textarea::placeholder { color: var(--ink-soft); }
.ar-form textarea { min-height: 64px; padding: 14px 18px; resize: vertical; line-height: 1.45; }
.ar-form select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238A8177' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.ar-form select option { color: #111; }
.ar-form-optional {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ar-form .button { border: none; cursor: pointer; justify-self: start; margin-top: 6px; }
.ar-form-success {
  margin-top: 16px;
  color: var(--acc-deep);
  font-size: 16px;
  font-weight: 600;
}

.ar-bridge {
  max-width: 560px;
  margin: 8px auto 26px;
  text-align: center;
  color: var(--ink);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.4;
  font-weight: 600;
}

.ar-offer-paid .button { width: 100%; min-height: 56px; font-size: 17px; }

.ar-retake {
  display: block;
  margin: 32px auto 0;
  appearance: none;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.ar-retake:hover { color: var(--ink); }

/* entrance animation for question swaps */
.ar-anim-in { animation: ar-fade-in 360ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes ar-fade-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 780px) {
  .ar-bar-row { grid-template-columns: 132px 1fr 34px; gap: 10px; }
  .ar-bar-title { font-size: 13px; }
  .ar-bar-gloss { font-size: 11px; }
  .ar-step { grid-template-columns: 1fr; gap: 4px; }
  .ar-form .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ar-anim-in { animation: none; }
  .ar-progress-bar, .ar-bar-fill { transition: none; }
}

/* ── Print: clean, light, report-only ── */
@media print {
  @page { margin: 18mm; }

  html, body {
    background: #fff !important;
    color: #111 !important;
  }
  body { background-image: none !important; }

  /* hide everything that isn't the report */
  .nav,
  footer,
  .ar-intro,
  .ar-quiz,
  .ar-offer,
  .ar-bridge,
  .ar-retake,
  .ar-download { display: none !important; }

  main { display: block !important; }
  .ar-result {
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  .ar-result-inner { width: 100% !important; max-width: 100% !important; }

  /* branded print header */
  .ar-print-head {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 22px;
    border-bottom: 1px solid #ddd;
  }
  .ar-print-brand { font-size: 20px; font-weight: 800; letter-spacing: -0.04em; color: #111 !important; }
  .ar-print-meta { font-size: 11px; color: #666 !important; font-family: var(--font-sans); }

  /* dark text on white */
  .ar-result .eyebrow,
  .ar-breakdown-label { color: #93391F !important; }
  .ar-tier-title,
  .ar-bar-title,
  .ar-step-area,
  .ar-weakest strong { color: #111 !important; }
  .ar-tier-desc,
  .ar-bar-gloss,
  .ar-bar-val,
  .ar-weakest,
  .ar-step-text,
  .ar-step-allgood { color: #333 !important; }

  /* force solid score color for print */
  .ar-score-num {
    background: none !important;
    -webkit-text-fill-color: #93391F !important;
    color: #93391F !important;
    text-shadow: none !important;
  }
  .ar-score-of { color: #666 !important; }

  /* bars: force colors to print */
  .ar-bar-track { background: #EDE7DB !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ar-bar-fill { background: #93391F !important; transition: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .ar-steps { border-top: 1px solid #EDE7DB !important; }
  .ar-step,
  .ar-step-allgood { border: none !important; border-bottom: 1px solid #EDE7DB !important; background: none !important; }
  .ar-step-good .ar-step-area::before,
  .ar-step-allgood::before { color: #93391F !important; }

  .ar-breakdown, .ar-nextsteps, .ar-step, .ar-maturity { break-inside: avoid; }
  .ar-maturity-line { color: #333 !important; }
  .ar-maturity-line strong { color: #111 !important; }
  .ar-maturity .service-more { display: none !important; }
}
