/* ============================================================
   BSS Website Health Quiz — style.css
   Theme: editorial-professional. Warm paper, deep teal, coral CTA.
   System fonts only (no CDN dependency). Mobile-first.
   Edit the variables below to retheme quickly.
   ============================================================ */

:root {
  /* Colors */
  --paper:      #F6F3EC;   /* warm background */
  --paper-2:    #FFFFFF;   /* cards */
  --ink:        #15171C;   /* near-black text */
  --ink-soft:   #4A4E57;   /* secondary text */
  --teal:       #115E59;   /* brand primary */
  --teal-deep:  #0C3F3C;   /* darker teal */
  --coral:      #E8603C;   /* action / CTA accent */
  --coral-deep: #C84A29;
  --line:       #E1DACB;   /* hairlines on paper */

  /* Tier colors */
  --tier-critical: #C23B22;
  --tier-risk:     #D98324;
  --tier-work:     #B59A2B;
  --tier-solid:    #2F7D5B;

  /* Type — system stacks, no external fonts */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Shape */
  --radius: 18px;
  --shadow: 0 18px 50px -20px rgba(12, 63, 60, 0.35);
  --maxw: 620px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Subtle atmosphere: soft teal glow top-left, warm glow bottom-right */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.20;
  z-index: 0;
  pointer-events: none;
}
body::before { top: -25vw; left: -20vw; background: var(--teal); }
body::after  { bottom: -30vw; right: -25vw; background: var(--coral); opacity: 0.14; }

/* Fine grain overlay for paper texture (inline data-URI, not a CDN asset) */
.bg-grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header / Footer ---------- */
.site-head {
  position: relative; z-index: 2;
  padding: 22px 24px;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
}
.wordmark { display: flex; align-items: baseline; gap: 10px; }
.wm-mark {
  font-family: var(--serif); font-weight: 700; font-size: 1.4rem;
  color: var(--teal); letter-spacing: 0.5px;
}
.wm-name { font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }

.site-foot {
  position: relative; z-index: 2;
  margin-top: auto;
  padding: 30px 24px 40px;
  text-align: center;
  font-size: 0.8rem; color: var(--ink-soft);
}
.site-foot .dot { margin: 0 8px; opacity: 0.5; }

/* ---------- Stage / Cards ---------- */
.stage {
  position: relative; z-index: 2;
  flex: 1;
  width: 100%; max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px 40px;
  display: flex; align-items: flex-start;
}

.card {
  display: none;
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 34px;
}
.card.is-active {
  display: block;
  animation: rise 0.5s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Type ---------- */
.eyebrow {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--coral-deep);
  margin-bottom: 14px;
}
.headline {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.1;
  letter-spacing: -0.01em; color: var(--ink);
  margin-bottom: 16px;
}
.headline.sm { font-size: clamp(1.5rem, 5vw, 2rem); }
.lede {
  font-size: 1.05rem; color: var(--ink-soft);
  max-width: 48ch; margin-bottom: 24px;
}
.microcopy { font-size: 0.82rem; color: var(--ink-soft); margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 15px 30px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  display: inline-block; text-align: center; text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.full { display: block; width: 100%; }

.btn-primary {
  background: var(--teal); color: #fff;
  box-shadow: 0 10px 24px -10px rgba(17,94,89,0.7);
}
.btn-primary:hover { background: var(--teal-deep); transform: translateY(-1px); }

.btn-cta {
  background: var(--coral); color: #fff;
  box-shadow: 0 12px 26px -10px rgba(232,96,60,0.75);
  font-size: 1.08rem; padding: 17px 30px;
}
.btn-cta:hover { background: var(--coral-deep); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; color: var(--ink-soft);
  padding: 10px 6px; font-weight: 500; font-size: 0.9rem;
}
.btn-ghost:hover { color: var(--ink); }
.btn-ghost[hidden] { display: none; }

/* ---------- Progress ---------- */
.progress-wrap { margin-bottom: 30px; }
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 8px; letter-spacing: 0.02em;
}
.progress-track {
  height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  border-radius: 999px;
  transition: width .45s cubic-bezier(.2,.7,.2,1);
}

/* ---------- Question ---------- */
.question-area { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

.q-text {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.35rem, 4.5vw, 1.7rem); line-height: 1.22;
  margin-bottom: 22px; color: var(--ink);
}
.answers { display: flex; flex-direction: column; gap: 12px; }
.answer {
  text-align: left; width: 100%;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  cursor: pointer; transition: all .16s ease;
  display: flex; align-items: center; gap: 14px;
}
.answer:hover { border-color: var(--teal); background: #fff; transform: translateX(3px); }
.answer .tick {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); transition: all .16s ease;
}
.answer.chosen { border-color: var(--teal); background: #fff; }
.answer.chosen .tick { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 3px #fff; }

.quiz-nav { margin-top: 24px; }

/* ---------- Email gate ---------- */
.trust {
  font-size: 0.92rem; color: var(--ink);
  background: rgba(17,94,89,0.06);
  border-left: 3px solid var(--teal);
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 22px;
}
.trust strong { color: var(--teal-deep); }
.gate-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.field label .opt { font-weight: 400; color: var(--ink-soft); }
.field input {
  font-family: var(--sans); font-size: 1rem;
  padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; background: var(--paper); color: var(--ink);
  transition: border-color .16s ease, background .16s ease;
}
.field input:focus { outline: none; border-color: var(--teal); background: #fff; }
.gate-form .btn { margin-top: 6px; }

/* ---------- Results ---------- */
.results { text-align: center; }
.score-ring {
  width: 150px; height: 150px; border-radius: 50%;
  margin: 0 auto 22px;
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  background: var(--paper);
  border: 8px solid var(--tier-work);
  animation: pop .5s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.score-num { font-family: var(--serif); font-weight: 700; font-size: 3.4rem; line-height: 1; color: var(--ink); }
.score-of  { font-size: 1rem; color: var(--ink-soft); font-weight: 600; }

.tier-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 10px;
}
.results .lede { margin-left: auto; margin-right: auto; }

/* weak spots */
.weakspots {
  text-align: left; max-width: 44ch; margin: 0 auto 22px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.weak-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; color: var(--ink); }
.weakspots ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.weakspots li {
  font-size: 0.92rem; color: var(--ink-soft);
  padding-left: 22px; position: relative;
}
.weakspots li::before {
  content: "→"; position: absolute; left: 0; color: var(--coral); font-weight: 700;
}

.diffs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 4px 0 26px;
}
.diffs span {
  font-size: 0.78rem; font-weight: 600; color: var(--teal);
  background: rgba(17,94,89,0.08);
  border: 1px solid rgba(17,94,89,0.18);
  padding: 6px 12px; border-radius: 999px;
}
.risk-reversal {
  font-size: 0.88rem; color: var(--ink-soft);
  max-width: 44ch; margin: 16px auto 0;
}
.risk-reversal strong { color: var(--ink); }

/* Tier accent applied via body class set by JS */
.tier-critical .score-ring { border-color: var(--tier-critical); }
.tier-critical .tier-label { color: var(--tier-critical); }
.tier-risk .score-ring { border-color: var(--tier-risk); }
.tier-risk .tier-label { color: var(--tier-risk); }
.tier-work .score-ring { border-color: var(--tier-work); }
.tier-work .tier-label { color: var(--tier-work); }
.tier-solid .score-ring { border-color: var(--tier-solid); }
.tier-solid .tier-label { color: var(--tier-solid); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .card { padding: 30px 22px; }
  .site-head { padding: 18px 20px; }
  .stage { padding: 8px 16px 30px; }
}
