/* ===========================================================================
   Analytica AI Advisor — stylesheet
   Dark, glass-elevated, violet/teal accent. No frameworks, no build step.
   =========================================================================== */

:root {
  --bg:            #07080d;
  --bg-raise:      #0d0f17;
  --glass:         rgba(255, 255, 255, 0.035);
  --glass-strong:  rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.09);
  --border-bright: rgba(255, 255, 255, 0.16);

  --text:      #eef0f6;
  --text-soft: #a7adc0;
  --text-mute: #6f7689;

  --violet: #7c5cff;
  --teal:   #22d3ee;
  --lilac:  #c084fc;
  --accent-grad: linear-gradient(135deg, #22d3ee 0%, #7c5cff 55%, #c084fc 100%);

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1080px;

  --shadow-soft: 0 1px 0 rgba(255,255,255,0.05) inset, 0 18px 40px -24px rgba(0,0,0,0.9);
  --shadow-lift: 0 1px 0 rgba(255,255,255,0.07) inset, 0 28px 60px -28px rgba(0,0,0,1);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { 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,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background glow ------------------------------------------------- */
.aurora {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 90vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(45vw 45vh at 22% 8%,  rgba(124, 92, 255, 0.20), transparent 70%),
    radial-gradient(40vw 40vh at 82% 2%,  rgba(34, 211, 238, 0.14), transparent 70%),
    radial-gradient(55vw 40vh at 55% 34%, rgba(192, 132, 252, 0.08), transparent 75%);
  filter: blur(6px);
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

/* Typography -------------------------------------------------------------- */
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.025em; font-weight: 640; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.9rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.4rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.08rem; }
p  { margin: 0 0 1rem; color: var(--text-soft); }
em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text;
     background-clip: text; color: transparent; }
a  { color: var(--text); text-decoration: none; }

.section-title { margin-bottom: 0.4rem; }
.section-sub { color: var(--text-mute); max-width: 62ch; margin-bottom: 1.9rem; font-size: 0.96rem; }

/* Header ------------------------------------------------------------------ */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 2.4rem);
  max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 9px; background: var(--accent-grad); color: #0a0a12;
  box-shadow: 0 6px 18px -8px rgba(124, 92, 255, 0.9);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { font-weight: 660; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 0.5rem; }
.brand-sub { font-weight: 480; font-size: 0.82rem; color: var(--text-mute); letter-spacing: 0.01em; }
.site-nav { display: flex; gap: 1.4rem; font-size: 0.9rem; }
.site-nav a { color: var(--text-mute); transition: color 0.2s var(--ease); }
.site-nav a:hover { color: var(--text); }

/* Views + transitions ----------------------------------------------------- */
.view { display: none; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.4rem) 4rem; }
.view.is-active { display: block; animation: viewIn 0.5s var(--ease) both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 560; letter-spacing: -0.01em;
  padding: 0.7rem 1.25rem; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease),
                              background 0.25s var(--ease), border-color 0.25s var(--ease),
                              opacity 0.2s var(--ease);
  white-space: nowrap;
}
.btn-lg { padding: 0.92rem 1.6rem; font-size: 1.02rem; border-radius: 13px; }
.btn:active { transform: translateY(1px) scale(0.995); }

.btn-primary {
  background: var(--accent-grad); color: #07080d; font-weight: 640;
  box-shadow: 0 10px 30px -14px rgba(124, 92, 255, 0.95);
}
.btn-primary:hover { box-shadow: 0 16px 38px -14px rgba(124, 92, 255, 1); transform: translateY(-1px); }

.btn-ghost {
  background: var(--glass); color: var(--text); border-color: var(--border);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--glass-strong); border-color: var(--border-bright); }

.btn[disabled] { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Pills ------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.38rem 0.85rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-soft); letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Hero -------------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 2.5rem; max-width: 52rem; }
.hero h1 { margin-top: 1.1rem; }
.lede { font-size: clamp(1.02rem, 1.7vw, 1.2rem); max-width: 54ch; color: var(--text-soft); }
.lede strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.9rem 0 1.6rem; }
.trust-row {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem;
  font-size: 0.87rem; color: var(--text-mute);
}

/* Stat strip -------------------------------------------------------------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin: 1.5rem 0 4.5rem;
}
.stat { background: var(--bg-raise); padding: 1.35rem 1.2rem; text-align: center; }
.stat-num {
  display: block; font-size: 1.75rem; font-weight: 660; letter-spacing: -0.03em;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: 0.79rem; color: var(--text-mute); }

/* Cards ------------------------------------------------------------------- */
.how { padding-top: 1.5rem; scroll-margin-top: 2rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1rem; }
.card {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; backdrop-filter: blur(14px); box-shadow: var(--shadow-soft);
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--border-bright); box-shadow: var(--shadow-lift); }
.card-step {
  display: inline-block; font-size: 0.74rem; font-weight: 640; letter-spacing: 0.14em;
  color: var(--violet); margin-bottom: 0.9rem;
}
.card p { font-size: 0.92rem; margin: 0; }

/* Credibility ------------------------------------------------------------- */
.credibility { margin-top: 4rem; }
.cred-inner {
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.10), rgba(34, 211, 238, 0.04));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem); backdrop-filter: blur(14px);
}
.cred-inner p { max-width: 64ch; }

/* ─────────────────────────────── QUIZ ─────────────────────────────── */
.quiz-shell {
  max-width: 720px; margin: clamp(1.5rem, 5vw, 3.5rem) auto 0;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.3rem, 3.5vw, 2.2rem); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lift);
}
.quiz-progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.82rem; color: var(--text-mute); margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
#step-counter { font-weight: 560; color: var(--text-soft); }
.progress-track {
  height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 20%; border-radius: 999px; background: var(--accent-grad);
  transition: width 0.55s var(--ease);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.55);
}

.step-container { margin: 1.9rem 0 1.5rem; min-height: 320px; }

.step { animation: stepIn 0.42s var(--ease) both; }
.step.leaving { animation: stepOut 0.2s var(--ease) both; }
@keyframes stepIn  { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes stepOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-16px); } }

.step-eyebrow {
  font-size: 0.74rem; font-weight: 640; letter-spacing: 0.15em;
  color: var(--teal); text-transform: uppercase; margin-bottom: 0.55rem;
}
.step h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin-bottom: 0.35rem; }
.step-help { font-size: 0.88rem; color: var(--text-mute); margin-bottom: 1.4rem; }

/* Option lists ------------------------------------------------------------ */
.options { display: grid; gap: 0.6rem; }
.options.two-col { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.option {
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border);
  cursor: pointer; text-align: left; width: 100%; font: inherit; color: var(--text);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.16s var(--ease);
}
.option:hover { background: var(--glass-strong); border-color: var(--border-bright); transform: translateX(2px); }
.option.is-selected {
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.16), rgba(34, 211, 238, 0.07));
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25), 0 10px 26px -18px rgba(124, 92, 255, 0.9);
}
.option-marker {
  flex: none; width: 19px; height: 19px; margin-top: 2px;
  border: 1.5px solid var(--border-bright); display: grid; place-items: center;
  transition: all 0.2s var(--ease); color: transparent; font-size: 11px; font-weight: 800;
}
.option-marker.radio { border-radius: 50%; }
.option-marker.check { border-radius: 6px; }
.option.is-selected .option-marker {
  background: var(--accent-grad); border-color: transparent; color: #07080d;
}
.option-body { display: flex; flex-direction: column; gap: 0.12rem; }
.option-label { font-weight: 540; letter-spacing: -0.01em; }
.option-note { font-size: 0.8rem; color: var(--text-mute); }

/* Select ------------------------------------------------------------------ */
.select-wrap { position: relative; }
.select-wrap::after {
  content: '▾'; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text-mute);
}
select {
  width: 100%; appearance: none; font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.95rem 2.4rem 0.95rem 1rem; cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
select:hover { border-color: var(--border-bright); }
select:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
select option { background: #11131d; color: var(--text); }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

/* Quiz footer ------------------------------------------------------------- */
.quiz-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1.2rem; border-top: 1px solid var(--border);
}
.quiz-hint { font-size: 0.8rem; color: var(--text-mute); text-align: center; flex: 1; }

/* ────────────────────────────── RESULTS ────────────────────────────── */
.results-shell { padding-top: clamp(1.5rem, 5vw, 3rem); }

.score-panel {
  display: grid; grid-template-columns: 230px 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.10), rgba(34, 211, 238, 0.035));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.6rem); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lift);
}
.gauge-wrap { position: relative; width: 210px; height: 210px; margin: 0 auto; }
.gauge { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track {
  fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 14;
}
.gauge-value {
  fill: none; stroke: url(#gauge-grad); stroke-width: 14; stroke-linecap: round;
  stroke-dasharray: 515.2; stroke-dashoffset: 515.2;
  transition: stroke-dashoffset 1.5s var(--ease);
  filter: drop-shadow(0 0 10px rgba(124, 92, 255, 0.55));
}
.gauge-centre {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge-score {
  display: block; font-size: 3.3rem; font-weight: 680; letter-spacing: -0.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gauge-outof { font-size: 0.8rem; color: var(--text-mute); }

.pill-tier {
  background: rgba(124, 92, 255, 0.16); border-color: rgba(124, 92, 255, 0.45);
  color: var(--text); font-weight: 600; margin-bottom: 0.9rem;
}
.score-copy h2 { margin-bottom: 0.6rem; }
.score-context { font-size: 0.88rem; color: var(--text-mute); margin: 0; }

/* Breakdown --------------------------------------------------------------- */
.breakdown {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem; margin: 1rem 0 3.5rem;
}
.bd-item {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem; backdrop-filter: blur(10px);
}
.bd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.55rem; }
.bd-label { font-size: 0.83rem; color: var(--text-soft); }
.bd-val { font-size: 0.8rem; color: var(--text-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-track { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bd-fill {
  height: 100%; width: 0; border-radius: 999px; background: var(--accent-grad);
  transition: width 1.1s var(--ease);
}

.results-block { margin-bottom: 3.5rem; }

/* Tool cards -------------------------------------------------------------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.tool-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem; backdrop-filter: blur(14px); box-shadow: var(--shadow-soft);
  animation: cardIn 0.5s var(--ease) both;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--border-bright); box-shadow: var(--shadow-lift); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.tool-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.tool-name { font-size: 1.12rem; font-weight: 620; letter-spacing: -0.02em; margin: 0; }
.tool-vendor { font-size: 0.78rem; color: var(--text-mute); }
.tool-rank {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; color: #07080d; background: var(--accent-grad);
}
.tool-cat {
  align-self: flex-start; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal); background: rgba(34, 211, 238, 0.09);
  border: 1px solid rgba(34, 211, 238, 0.22); border-radius: 999px; padding: 0.22rem 0.6rem;
}
.tool-why { font-size: 0.9rem; margin: 0; color: var(--text-soft); }
.tool-match {
  font-size: 0.84rem; color: var(--text); margin: 0;
  padding: 0.7rem 0.85rem; border-radius: var(--radius-sm);
  background: rgba(124, 92, 255, 0.09); border: 1px solid rgba(124, 92, 255, 0.22);
}
.tool-match strong { color: var(--lilac); font-weight: 600; }
.tool-link {
  margin-top: auto; padding-top: 0.5rem; font-size: 0.84rem; color: var(--text-mute);
  transition: color 0.2s var(--ease);
}
.tool-link:hover { color: var(--teal); }

/* Roadmap ----------------------------------------------------------------- */
.roadmap { list-style: none; counter-reset: rm; padding: 0; margin: 0; display: grid; gap: 1rem; }
.roadmap li {
  position: relative; counter-increment: rm;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.4rem 4.2rem; backdrop-filter: blur(14px);
  animation: cardIn 0.5s var(--ease) both;
}
.roadmap li::before {
  content: counter(rm); position: absolute; left: 1.35rem; top: 1.35rem;
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  font-size: 0.9rem; font-weight: 700; color: #07080d; background: var(--accent-grad);
}
.rm-horizon {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 0.3rem;
}
.rm-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.4rem; letter-spacing: -0.02em; }
.rm-detail { font-size: 0.92rem; margin: 0; color: var(--text-soft); }

/* CTA --------------------------------------------------------------------- */
.cta-panel {
  text-align: center; border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.14), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(124, 92, 255, 0.28);
  padding: clamp(2rem, 5vw, 3rem) clamp(1.3rem, 4vw, 3rem);
  backdrop-filter: blur(16px); margin-bottom: 2rem;
}
.cta-panel p { max-width: 58ch; margin-inline: auto; }
.cta-fine { font-size: 0.83rem; color: var(--text-mute); margin: 1.2rem 0 0; }

.results-foot { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* Footer ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 3rem;
  padding: 2.2rem clamp(1rem, 4vw, 2.4rem) 3rem;
  max-width: var(--maxw); margin-inline: auto;
}
.site-footer p { margin: 0 0 0.5rem; font-size: 0.88rem; }
.footer-fine { color: var(--text-mute); font-size: 0.82rem !important; max-width: 70ch; }

/* Loading ----------------------------------------------------------------- */
.loading { display: grid; place-items: center; gap: 1rem; min-height: 320px; text-align: center; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1); border-top-color: var(--violet);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-box {
  border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08);
  border-radius: var(--radius-sm); padding: 1rem 1.15rem; color: #fca5a5; font-size: 0.9rem;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 800px) {
  .score-panel { grid-template-columns: 1fr; text-align: center; }
  .score-copy .pill-tier { margin-inline: auto; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .site-nav { gap: 1rem; font-size: 0.85rem; }
  .brand-sub { display: none; }
  .hero-cta .btn { width: 100%; }
  .quiz-foot { flex-wrap: wrap; }
  .quiz-hint { order: 3; flex-basis: 100%; }
  .quiz-foot .btn { flex: 1; }
  .roadmap li { padding: 3.6rem 1.2rem 1.3rem; }
  .roadmap li::before { top: 1.2rem; left: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* Print / Save-as-PDF ----------------------------------------------------- */
@media print {
  .aurora, .site-header, .quiz-foot, .results-foot, .site-footer { display: none !important; }
  body { background: #fff; color: #111; }
  .view, .card, .tool-card, .roadmap li, .score-panel, .cta-panel, .bd-item {
    background: #fff !important; border-color: #ddd !important; box-shadow: none !important;
    backdrop-filter: none !important; break-inside: avoid;
  }
  h1, h2, h3, p, .tool-name, .rm-title { color: #111 !important; }
  .gauge-score { color: #111 !important; }
}
