/* =============================================================================
   AI Profiler V2  —  styles
   Palette and type are fixed by the design system. Editorial, mono accents,
   lemon used sparingly, charcoal panels for the chart.
   ============================================================================= */

:root {
  /* palette */
  --ink: #232220;
  --ink-panel: #2c2a27;
  --paper: #FBFAF6;
  --paper-2: #F2EEE3;
  --lemon: #E9DC4E;          /* brand yellow: only legible on the dark panels */
  --lemon-deep: #D4C528;     /* yellow for fills: button hover, progress bar, focus ring */
  --lemon-text: #8A7A12;     /* yellow for TEXT on light paper (brand yellow is unreadable there) */
  --growth: #C0662F;         /* growth areas: the Everyday AI orange, deepened to read on paper */
  --taupe: #B6A892;
  --taupe-deep: #8A7B66;

  /* type */
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  /* scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.4vw, 4.4rem);

  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 9px;
  --line: 1px solid rgba(35, 34, 32, 0.14);
  --shadow: 0 18px 50px -28px rgba(35, 34, 32, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.mono { font-family: var(--mono); }
.accent { color: var(--lemon-text); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* focus visibility everywhere */
:focus-visible {
  outline: 3px solid var(--lemon-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- layout shell ------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: var(--maxw); margin: 0 auto;
  padding: 18px 24px 0;
}
.wordmark { display: flex; align-items: baseline; gap: 8px; }
.wordmark-code {
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
  background: var(--ink); color: var(--lemon); padding: 2px 8px; border-radius: 6px;
}
.wordmark-text { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
.topbar-tag { margin: 0; color: var(--taupe-deep); font-size: var(--step--1); }
.csc-logo { height: 56px; width: auto; display: block; }

.stage { max-width: var(--maxw); margin: 0 auto; padding: 24px; }

.sitefoot {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px;
  color: var(--taupe-deep); font-size: var(--step--1); border-top: var(--line);
}
.sitefoot p { margin: 0; }

/* ---- buttons ------------------------------------------------------------ */

.btn {
  font-family: var(--body); font-size: var(--step-0); font-weight: 600;
  border: 2px solid transparent; border-radius: 999px;
  padding: 12px 26px; cursor: pointer; transition: transform .12s ease, background .2s ease, color .2s ease;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lemon); color: var(--ink); border-color: var(--ink); }
.btn-primary:hover { background: var(--lemon-deep); }
.btn-secondary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-secondary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(35,34,32,.25); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.btn-back::before { content: "\2190"; margin-right: 8px; }

/* =============================================================================
   START SCREEN
   ============================================================================= */

.start-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px;
  align-items: center; padding: clamp(24px, 5vw, 72px) 0;
}
.eyebrow {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em;
  font-size: var(--step--1); color: var(--taupe-deep); margin: 0 0 18px;
}
.display-xl {
  font-family: var(--display); font-weight: 800; font-size: var(--step-4);
  line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 22px;
}
.start-personas {
  font-family: var(--display); font-weight: 700; font-size: var(--step-2);
  line-height: 1.2; margin: 0 0 18px; color: var(--ink);
}
.start-personas .accent { color: var(--lemon-text); }
.lede { font-size: var(--step-1); max-width: 46ch; margin: 0 0 32px; color: #38362f; }

.name-form {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; margin-bottom: 28px; max-width: 380px;
}
.field-label {
  display: block; font-family: var(--mono); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: .08em; color: var(--taupe-deep); margin-bottom: 10px;
}
.name-form .field-label { margin-bottom: 0; }
.text-input {
  width: 100%; font-family: var(--body); font-size: var(--step-0);
  padding: 11px 14px; border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
}
.name-submit { margin-top: 2px; }
.text-input::placeholder { color: var(--taupe); }
.field-error { color: #a23a1e; font-size: var(--step--1); margin: 10px 0 0; }

.start-meta {
  list-style: none; display: flex; gap: 28px; padding: 0; margin: 0;
  flex-wrap: wrap; color: var(--taupe-deep); font-size: var(--step--1);
}
.start-meta .mono { color: var(--ink); font-size: var(--step-1); margin-right: 6px; }
.start-meta li { display: flex; align-items: baseline; }

.start-aside {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow);
}
.mystery-stage {
  position: relative; width: 180px; margin: 2px auto 22px;
  display: grid; place-items: center;
  animation: float 3.4s ease-in-out infinite;
}
/* the silhouette PNG is used as a mask, so it renders in the lemon accent
   colour and stays visible on the charcoal card whatever colour the art is */
.mystery-img {
  width: 180px; height: 196px; display: block;
  background-color: var(--lemon);
  -webkit-mask: url("images/mystery.png") center / contain no-repeat;
          mask: url("images/mystery.png") center / contain no-repeat;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.4));
}
/* plain black "?" sitting on top of the silhouette */
.mystery-mark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--ink); font-size: 3.6rem; font-weight: 700; line-height: 1;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.aside-kicker {
  text-align: center; text-transform: uppercase; letter-spacing: .16em;
  font-size: var(--step--1); color: var(--taupe); margin: 0 0 22px;
}
.blink { color: var(--lemon); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tier-stack { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.tier-chip {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid rgba(251,250,246,.2); border-radius: 999px; padding: 10px 18px;
}
.tier-chip .mono { color: var(--lemon); font-weight: 700; }
.tier-chip:nth-child(2) { margin-left: 18px; }
.tier-chip:nth-child(3) { margin-left: 36px; }
.aside-note { font-size: var(--step--1); color: var(--taupe); margin: 0; }

/* =============================================================================
   QUIZ SCREEN
   ============================================================================= */

.quiz-head { margin: 16px 0 36px; }
.quiz-progress-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.quiz-counter { font-size: var(--step-0); color: var(--taupe-deep); letter-spacing: .04em; }
.quiz-counter #q-current { color: var(--ink); font-weight: 700; }

.progress-track {
  height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0; background: var(--lemon-deep);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}

.q-card { max-width: 720px; }
.q-kicker {
  text-transform: uppercase; letter-spacing: .1em; font-size: var(--step--1);
  color: var(--taupe-deep); margin: 0 0 14px;
}
.q-prompt {
  font-family: var(--display); font-weight: 700; font-size: var(--step-3);
  line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 30px;
}
.q-prompt:has(+ .q-hint) { margin-bottom: 14px; }
.q-hint {
  display: inline-block; margin: 0 0 24px;
  font-size: var(--step--1); font-weight: 700; color: var(--ink);
  background: var(--lemon); padding: 8px 15px; border-radius: 999px;
}

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: flex-start; gap: 16px; text-align: left;
  font-family: var(--body); font-size: var(--step-0); color: var(--ink);
  background: var(--paper); border: 2px solid rgba(35,34,32,.16);
  border-radius: var(--radius-sm); padding: 16px 20px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.option:hover { border-color: var(--ink); background: var(--paper-2); }
.option:active { transform: translateY(1px); }
.option.selected { border-color: var(--ink); background: var(--lemon); }
.option-mark {
  font-family: var(--mono); font-weight: 700; font-size: .85rem;
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 6px;
  display: grid; place-items: center; background: var(--paper-2); color: var(--ink);
  margin-top: 1px;
}
.option.selected .option-mark { background: var(--ink); color: var(--lemon); }
.option-text { flex: 1; }

/* wishlist multi select: square check box instead of the radio mark */
.option-check { align-items: center; }
.option-box {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px;
  border: 2px solid rgba(35,34,32,.3); background: var(--paper); position: relative;
}
.option-check.selected .option-box { background: var(--ink); border-color: var(--ink); }
.option-check.selected .option-box::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid var(--lemon); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.option-check.selected { background: var(--paper-2); border-color: var(--ink); }

.focus-finish {
  margin-top: 22px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.focus-note { color: var(--taupe-deep); font-size: var(--step--1); margin: 0; }
.focus-finish .btn:disabled { opacity: .45; cursor: not-allowed; }

.quiz-nudge {
  margin-top: 22px; font-family: var(--display); font-style: italic;
  color: var(--taupe-deep); min-height: 1.4em; font-size: var(--step-1);
}

/* =============================================================================
   DETAILS FORM
   ============================================================================= */

.details-card { max-width: 560px; }
.details-sub { color: var(--taupe-deep); margin: 0 0 28px; max-width: 50ch; }
.details-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; }
.select-input { appearance: none; cursor: pointer; background-image: none; }
.consent-row {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  font-size: var(--step--1); color: #38362f; line-height: 1.4;
}
.consent-row input {
  width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; accent-color: var(--lemon-deep);
}
.details-actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: 6px; }
/* Reveal Results and Back are stacked and share the same full width + height. */
.details-actions .btn-primary,
.details-actions .btn-back { width: 100%; text-align: center; }

/* =============================================================================
   RESULTS
   ============================================================================= */

.report { display: flex; flex-direction: column; gap: 44px; }
.block { scroll-margin-top: 20px; }
.block-title {
  font-family: var(--display); font-weight: 700; font-size: var(--step-2);
  letter-spacing: -0.02em; margin: 0 0 6px;
}
.block-sub { color: var(--taupe-deep); margin: 0 0 20px; max-width: 60ch; }

/* ---- reveal hero -------------------------------------------------------- */

.reveal {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px); box-shadow: var(--shadow); overflow: hidden;
}
.reveal-inner {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.reveal-emblem {
  width: clamp(140px, 24vw, 210px); flex: 0 0 auto;
  display: grid; place-items: center; justify-self: center; margin: 0 auto;
}
.persona-avatar {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.35));
}
.emblem-svg { width: 100%; height: auto; display: block; }
.emblem-top {
  font-family: "Space Mono", monospace; fill: var(--taupe); font-size: 11px; letter-spacing: 3px;
}
.emblem-code {
  font-family: "Space Mono", monospace; fill: var(--lemon); font-size: 58px; font-weight: 700;
}
.emblem-name {
  font-family: "Space Mono", monospace; fill: var(--paper); font-size: 15px; letter-spacing: 2px;
}
.reveal-eyebrow {
  font-size: var(--step--1); color: var(--lemon); letter-spacing: .14em;
  text-transform: uppercase; margin: 0 0 10px;
}
.reveal-title {
  font-family: var(--display); font-weight: 800; font-size: var(--step-3);
  line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 14px;
}
.reveal-title .accent { color: var(--lemon); }
.reveal-quip {
  font-family: var(--display); font-style: italic; font-size: var(--step-1);
  color: #e8e3d6; margin: 0 0 18px; max-width: 50ch;
}
.reveal-tagline { font-size: var(--step-1); color: var(--lemon); margin: 0 0 16px; font-weight: 600; }
.reveal-desc { margin: 0; color: #d9d3c4; max-width: 56ch; }
.reveal-quip .accent { color: var(--lemon); font-weight: 700; font-style: normal; }

/* reveal animation, opt in via JS, never under reduced motion */
.reveal .reveal-text > * { opacity: 0; transform: translateY(12px); }
.reveal.reveal-in .reveal-text > * {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.reveal-in .reveal-text > *:nth-child(1) { transition-delay: .05s; }
.reveal.reveal-in .reveal-text > *:nth-child(2) { transition-delay: .15s; }
.reveal.reveal-in .reveal-text > *:nth-child(3) { transition-delay: .25s; }
.reveal.reveal-in .reveal-text > *:nth-child(4) { transition-delay: .35s; }
/* when JS does not add reveal-in (reduced motion), keep content visible */
@media (prefers-reduced-motion: reduce) {
  .reveal .reveal-text > * { opacity: 1; transform: none; }
}

/* ---- tier ladder -------------------------------------------------------- */

.ladder {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; padding: 0; margin: 0;
}
.ladder-step {
  border: 2px solid rgba(35,34,32,.16); border-radius: var(--radius);
  padding: 20px; background: var(--paper); display: flex; flex-direction: column; gap: 6px;
}
.ladder-step.active {
  background: var(--lemon); border-color: var(--ink); box-shadow: var(--shadow);
}
.ladder-code { font-size: var(--step-2); font-weight: 700; }
.ladder-name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); }
.ladder-tag { color: var(--taupe-deep); font-size: var(--step--1); }
.ladder-step.active .ladder-tag { color: #5a5230; }

/* ---- radar -------------------------------------------------------------- */

.radar-wrap {
  display: grid; grid-template-columns: 2.1fr 1fr; gap: 32px; align-items: center;
}
.radar-panel {
  background: var(--ink); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
}
.radar-mount { width: 100%; }
.radar-svg { width: 100%; height: auto; overflow: visible; }
.radar-ring { fill: none; stroke: rgba(251,250,246,.1); stroke-width: 1; }
.radar-ring-outer { stroke: rgba(251,250,246,.28); stroke-dasharray: 3 4; }
.radar-spoke { stroke: rgba(251,250,246,.1); stroke-width: 1; }
.radar-data { fill: rgba(233,220,78,.28); stroke: var(--lemon); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { stroke: var(--ink); stroke-width: 1.5; }
.radar-label { font-family: var(--body); fill: var(--paper); font-size: 16px; font-weight: 600; }

.callout {
  font-family: var(--display); font-size: var(--step-1); line-height: 1.3;
  margin: 0 0 20px;
}
.callout strong { color: var(--lemon-text); }
/* growth areas take the Everyday AI orange so they read apart from the strengths */
.callout strong.hl-growth { color: var(--growth); }
.radar-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px; }
.legend-name { flex: 1; }
.legend-score { color: var(--taupe-deep); }
/* a maxed skill reads "MAX" in the accent colour so it stands out as done */
.legend-max .legend-score { color: var(--lemon-deep); font-weight: 700; }
/* the weakest group (focus areas) is bolded so it draws the eye */
.legend-focus .legend-name, .legend-focus .legend-score { font-weight: 700; color: var(--ink); }

/* ---- badges ------------------------------------------------------------- */

.badge-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.badge {
  position: relative; text-align: left; font-family: var(--body);
  background: var(--paper); border: 2px solid rgba(35,34,32,.16);
  border-radius: var(--radius); padding: 22px 20px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  transition: border-color .15s ease;
}
.badge:hover { border-color: var(--ink); }
.badge-art {
  position: relative; width: 60px; height: 60px; display: grid; place-items: center;
}
.badge-art img { width: 100%; height: 100%; object-fit: contain; }
/* locked badges are dimmed and desaturated until earned */
.badge.locked .badge-art img { filter: grayscale(1); opacity: .5; }
/* a padlock chip sits over the locked badge art so it reads as locked at a glance */
.badge-lock {
  position: absolute; right: -6px; bottom: -6px;
  width: 26px; height: 26px; padding: 5px;
  fill: var(--paper); background: var(--ink);
  border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.badge.locked { background: var(--paper-2); }
.badge-name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); }
.badge-status {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .1em;
  color: var(--taupe-deep);
}
.badge.earned .badge-status { color: var(--lemon-text); }
.badge-detail {
  font-size: var(--step--1); color: #45433c; max-height: 0; opacity: 0;
  transition: max-height .25s ease, opacity .25s ease, margin .25s ease; margin-top: 0;
}
.badge:hover .badge-detail,
.badge.open .badge-detail {
  max-height: 8em; opacity: 1; margin-top: 4px;
}

/* ---- programmes --------------------------------------------------------- */

.rec-toggle {
  display: inline-flex; gap: 4px; padding: 5px; margin-bottom: 20px;
  background: var(--ink); border-radius: 999px;
}
.rec-toggle[hidden] { display: none; }
.rec-tab {
  font-family: var(--body); font-size: var(--step-0); font-weight: 700;
  color: var(--lemon); background: transparent; border: 0; cursor: pointer;
  padding: 10px 22px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.rec-tab:not(.active):hover { background: rgba(233,220,78,.15); }
.rec-tab.active { background: var(--lemon); color: var(--ink); }
.rec-count { font-size: .78rem; opacity: .75; margin-left: 4px; }

.programme-list { display: flex; flex-direction: column; gap: 10px; }
.empty-note { color: var(--taupe-deep); font-style: italic; margin: 0; }
.programme-soon-row { cursor: default; color: var(--taupe-deep); }
.programme-soon-row:hover { background: var(--paper); border-color: rgba(35,34,32,.14); }
.programme-soon {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--taupe-deep); border: 1px solid rgba(35,34,32,.2); padding: 3px 8px; border-radius: 5px;
}
.programme {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  color: var(--ink); background: var(--paper); border: var(--line);
  border-radius: var(--radius-sm); padding: 16px 20px;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.programme:hover { background: var(--paper-2); border-color: var(--ink); }
.programme:hover .programme-arrow { transform: translateX(4px); }
.programme-name { flex: 1; font-weight: 500; }
.programme-star { color: #D9824A; font-weight: 800; margin-left: 5px; }
.programme-skill {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--taupe-deep); white-space: nowrap; flex: 0 0 auto;
}
.programme-arrow { color: var(--taupe-deep); transition: transform .15s ease; }

/* skill-category group, always open. Label stacks above its programmes on mobile;
   on desktop it sits in a left column beside them (table-like). */
.rec-group { margin-top: 26px; }
#programme-list > .rec-group:first-child, #programmes-print > .rec-group:first-child { margin-top: 0; }
.rec-cat {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.rec-cat-name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.rec-cat-pill {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  background: var(--lemon); color: var(--ink); padding: 4px 11px; border-radius: 999px;
}

/* section subheadings (Programmes / E-learning) and the wishlist footnote */
.rec-subhead {
  font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase;
  letter-spacing: .1em; color: var(--taupe-deep); margin: 24px 0 12px;
}
#programme-list > .rec-subhead:first-child { margin-top: 0; }
.rec-footnote { font-size: var(--step--1); color: var(--taupe-deep); margin: 14px 0 0; }
.print-subhead {
  font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase;
  letter-spacing: .1em; color: var(--taupe-deep); margin: 16px 0 8px;
}

/* print-only recommendations block: hidden on screen, shown during PDF capture */
#programmes-print { display: none; }
#programmes-print .programme-list { margin-bottom: 18px; }
.print-subhead {
  font-family: var(--display); font-weight: 700; font-size: var(--step-1);
  margin: 4px 0 12px;
}
#programmes-print .print-subhead:not(:first-child) { margin-top: 22px; }

.secondary-block {
  margin-top: 28px; padding: 24px; background: var(--paper-2);
  border-radius: var(--radius); border: var(--line);
}
.secondary-title {
  font-family: var(--display); font-weight: 700; font-size: var(--step-1); margin: 0 0 16px;
}

/* ---- tools -------------------------------------------------------------- */

.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tool-card {
  text-decoration: none; color: var(--ink); background: var(--paper);
  border: 2px solid rgba(35,34,32,.16); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
  text-align: center;
  transition: border-color .15s ease, transform .1s ease;
}
.tool-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.tool-art {
  width: 100%; height: 132px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 6px;
}
.tool-art img { max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.tool-name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); }
.tool-desc { color: var(--taupe-deep); font-size: var(--step--1); }

/* ---- actions ------------------------------------------------------------ */

.actions {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px;
  padding-top: 28px; border-top: var(--line);
  align-items: center; justify-content: center;
}
/* collapsible Share menu groups "Email myself" and "Share via WhatsApp" */
.share-wrap { position: relative; display: inline-flex; }
.share-caret { font-size: .8em; margin-left: 2px; }
.share-menu {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  z-index: 20; min-width: 230px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.share-menu[hidden] { display: none; }
.share-option {
  font-family: var(--body); font-size: var(--step-0); text-align: left;
  background: transparent; border: 0; cursor: pointer; padding: 12px 14px;
  border-radius: 7px; color: var(--ink);
}
.share-option:hover { background: var(--paper-2); }

/* =============================================================================
   LIVE TIER CHART  (data page + event kiosk)
   ============================================================================= */

.live-badge {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  text-transform: uppercase; letter-spacing: .14em; font-size: var(--step--1);
  color: var(--taupe-deep);
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #D9824A;
  box-shadow: 0 0 0 0 rgba(217,130,74,.6); animation: livepulse 1.8s ease-out infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(217,130,74,.6); }
  70% { box-shadow: 0 0 0 9px rgba(217,130,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,130,74,0); }
}

.tier-chart {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  align-items: end; max-width: 620px; margin: 24px auto;
}
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* size mascots by a fixed HEIGHT so different source crops render the same size */
.chart-mascot { height: 64px; display: grid; place-items: center; }
.chart-mascot img { height: 64px; width: auto; max-width: 96px; object-fit: contain; }
.chart-count { font-size: var(--step-2); font-weight: 700; color: var(--ink); line-height: 1; }
.chart-share { font-size: var(--step--1); color: var(--taupe-deep); line-height: 1; }
.chart-bar-track {
  width: 100%; max-width: 120px; height: 190px;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--paper-2); border-radius: 10px 10px 0 0; overflow: hidden;
}
.chart-bar {
  width: 100%; min-height: 44px; border-radius: 10px 10px 0 0;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 8px;
  transition: height .6s cubic-bezier(.2,.8,.2,1);
}
.chart-bar-pct { font-family: var(--mono); font-weight: 700; font-size: 1.25rem; line-height: 1; }
/* shown when a tier has no responses yet: 0% on the empty track, no coloured bar */
.chart-bar-empty { font-family: var(--mono); font-weight: 700; font-size: 1.25rem; color: var(--taupe-deep); padding-bottom: 10px; }
.chart-label { font-family: var(--display); font-weight: 700; font-size: var(--step-0); text-align: center; white-space: nowrap; }
.chart-code { color: var(--taupe-deep); }
.chart-share { font-size: var(--step--1); color: var(--taupe-deep); }

/* ---- data page ---- */
/* Wide enough for the headline and the intro line to each sit on one row on a
   desktop screen (the headline needs ~855px at its largest size). The chart caps
   itself at 620px and stays centred, so it is unaffected. Narrow screens just
   wrap, which is what we want on a phone. */
.data-inner { max-width: 900px; margin: 0 auto; }
.data-topbar { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 22px; }
.data-title {
  font-family: var(--display); font-weight: 800; font-size: var(--step-3);
  line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 12px; text-align: center;
  text-wrap: balance;   /* when it must wrap (phones), split the lines evenly */
}
.data-msg { color: #38362f; max-width: 800px; margin: 0 auto; text-align: center; text-wrap: balance; }
.data-footer { display: flex; justify-content: center; margin-top: 30px; }
.data-since-line { color: var(--taupe-deep); font-size: var(--step--1); margin: 20px 0 0; text-align: center; }

/* ---- event kiosk (full screen, opened with #event) ---- */
.screen-event {
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; padding: 5vh 5vw;
}
/* critical: the display:flex above would otherwise beat the [hidden] attribute
   and leave this full-screen overlay always covering the profiler */
.screen-event[hidden] { display: none; }
.event-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; }
.live-badge-lg { font-size: clamp(1rem, 1.5vw, 1.6rem); color: var(--lemon); letter-spacing: .16em; }
.event-title {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; text-align: center;
  font-size: clamp(2rem, 4vw, 4.4rem); line-height: 1.04; margin: 0; max-width: 22ch;
}
.tier-chart-lg { max-width: min(64vw, 900px); gap: clamp(24px, 4vw, 64px); }
.tier-chart-lg .chart-mascot { height: clamp(72px, 8vw, 128px); }
.tier-chart-lg .chart-mascot img { height: clamp(72px, 8vw, 128px); max-width: 200px; }
.tier-chart-lg .chart-count { font-size: clamp(2rem, 4vw, 4rem); color: var(--paper); }
.tier-chart-lg .chart-bar-track { height: clamp(200px, 34vh, 420px); max-width: 200px; background: rgba(251,250,246,.1); }
.tier-chart-lg .chart-bar { min-height: 66px; padding-top: 16px; }
.tier-chart-lg .chart-bar-pct { font-size: clamp(1.4rem, 2.6vw, 3.2rem); }
.tier-chart-lg .chart-bar-empty { font-size: clamp(1.4rem, 2.6vw, 3.2rem); padding-bottom: 16px; }
.tier-chart-lg .chart-label { color: var(--paper); font-size: clamp(1rem, 1.5vw, 1.8rem); }
.tier-chart-lg .chart-code { color: var(--lemon); }
.tier-chart-lg .chart-share { color: var(--taupe); font-size: clamp(.85rem, 1.1vw, 1.2rem); }

.event-cta { position: absolute; right: 4vw; bottom: 4vh; display: flex; align-items: center; gap: 2vw; }
.event-cta-text { text-align: right; max-width: 24ch; }
.event-cta-lead { font-family: var(--display); font-weight: 800; margin: 0; line-height: 1.05; font-size: clamp(1.4rem, 2.3vw, 2.6rem); }
.event-cta-lead .accent { color: var(--lemon); }
.event-cta-sub { color: var(--taupe); margin: 8px 0 0; font-size: clamp(.9rem, 1.2vw, 1.4rem); }
.event-arrow { color: var(--lemon); width: clamp(80px, 8vw, 150px); flex: 0 0 auto; }
.event-arrow svg { width: 100%; height: auto; display: block; }
.event-qr {
  width: clamp(150px, 14vw, 260px); height: auto; border-radius: 14px;
  background: #fff; padding: 12px; flex: 0 0 auto;
  animation: qrglow 2.4s ease-in-out infinite;
}
@keyframes qrglow {
  0%, 100% { box-shadow: 0 0 22px 2px rgba(233,220,78,.4); }
  50% { box-shadow: 0 0 46px 12px rgba(233,220,78,.75); }
}

.data-title .accent { color: var(--lemon-text); }
.event-title .accent { color: var(--lemon); }
.screen-event .live-badge-lg { position: absolute; top: 4vh; left: 5vw; margin: 0; }

.show-all-btn {
  align-self: flex-start; margin-top: 8px; font-family: var(--body); font-weight: 600;
  font-size: var(--step--1); color: var(--ink); background: var(--paper-2);
  border: var(--line); border-radius: 999px; padding: 9px 18px; cursor: pointer;
}
.show-all-btn:hover { background: var(--paper); border-color: var(--ink); }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* On wider screens, let the question and the badge intro sit on one line
   rather than wrapping. Option rows stay a comfortable reading width. */
@media (min-width: 821px) {
  .q-card { max-width: 960px; }
  .q-prompt { font-size: 2rem; }
  .options { max-width: 720px; }
  .block-sub { max-width: none; }
}

@media (max-width: 820px) {
  .start-grid { grid-template-columns: 1fr; gap: 36px; }
  .start-aside { transform: none; order: -1; }
  .radar-wrap { grid-template-columns: 1fr; }
  .reveal-inner { grid-template-columns: 1fr; text-align: left; }
  .reveal-emblem { width: 150px; }
}

@media (max-width: 620px) {
  .stage { padding: 18px; }

  /* keep the tier ladder as a compact 3-across row so it does not eat the screen */
  .ladder { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ladder-step { padding: 12px 6px; align-items: center; text-align: center; gap: 2px; }
  .ladder-code { font-size: var(--step-1); }
  .ladder-name { font-size: var(--step--1); line-height: 1.15; }

  .badge-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .quiz-progress-row .btn { width: auto; }
  /* the Share button matches the others full-width on mobile */
  .share-wrap { width: 100%; }

  /* bigger, more legible skill chart on small screens */
  .radar-panel { padding: 16px; }
  .radar-label { font-size: 21px; }
  .radar-legend { font-size: var(--step-0); }
  .callout { font-size: var(--step-1); }

  /* badges always show detail on small screens where hover is unavailable */
  .badge-detail { max-height: 14em; opacity: 1; margin-top: 4px; }

  /* keep the name field a comfortable size, not full-bleed */
  .name-form { max-width: 100%; }
  .name-form .text-input { font-size: var(--step-0); padding: 12px 14px; }

  /* data page chart, tightened for small screens */
  .data-topbar .btn { width: auto; }
  .tier-chart { gap: 10px; }
  .chart-mascot { width: 46px; height: 46px; }
  .chart-count { font-size: var(--step-1); }
  .chart-bar-track { height: 150px; }
  .chart-label { font-size: var(--step--1); }
  .chart-share { font-size: .72rem; }

  /* event page falls back to a stacked layout if it is opened on a phone */
  .screen-event { padding: 4vh 6vw; overflow-y: auto; }
  .event-cta { position: static; flex-direction: column; text-align: center; margin: 4vh auto 0; gap: 16px; }
  .event-cta-text { text-align: center; }
  .event-arrow { transform: rotate(90deg); width: 64px; }
}

/* =============================================================================
   PRINT  /  PDF
   ============================================================================= */

@media print {
  .topbar, .sitefoot, .actions, .skip-link { display: none !important; }
  body { background: #fff; }
  .stage { max-width: none; padding: 0; }
  .reveal { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .radar-panel, .ladder-step.active, .badge.earned .badge-disc {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .block { break-inside: avoid; }
  .badge-detail { max-height: none; opacity: 1; }
  a { text-decoration: underline; color: var(--ink); }
}

/* ---- during PDF capture (.pdf-rendering) -------------------------------- *
 * The report is captured section by section (see buildReportPdf in app.js).
 * These rules pin every viewport-dependent value to a fixed one so the capture
 * is identical on any screen: a fixed report width, a fixed type scale (the
 * --step tokens use vw, which html2canvas cannot resolve reliably) and fixed
 * grid columns that never collapse to their mobile variants.
 * ------------------------------------------------------------------------- */

/* Fixed capture width — matches the px->mm scale assumed by the PDF builder. */
.pdf-rendering #report { width: 760px !important; margin: 0 auto !important; }

/* Pin the fluid type scale to fixed sizes (values at a ~desktop viewport). */
.pdf-rendering {
  --step--1: 0.88rem !important;
  --step-0: 1.05rem !important;
  --step-1: 1.35rem !important;
  --step-2: 1.8rem !important;
  --step-3: 2.6rem !important;
  --step-4: 3.4rem !important;
}

/* force every badge detail open so tips are captured, and hide the buttons */
.pdf-rendering .badge-detail { max-height: 8em !important; opacity: 1 !important; margin-top: 4px !important; }
.pdf-rendering .actions { display: none; }
/* keep the badge grid at three columns (never the mobile 2-up / 1-up) */
.pdf-rendering .badge-grid { grid-template-columns: repeat(3, 1fr) !important; }

/* html2canvas does not resolve clamp()/vw the way the browser does, so the
   reveal hero blows up. Pin fixed sizes and force the animated text visible. */
.pdf-rendering .reveal { padding: 36px !important; }
.pdf-rendering .reveal-inner { grid-template-columns: 190px 1fr !important; gap: 32px !important; }
.pdf-rendering .reveal-emblem { width: 190px !important; }
.pdf-rendering .reveal-title { font-size: 30px !important; }
.pdf-rendering .reveal-quip { font-size: 19px !important; }
.pdf-rendering .reveal .reveal-text > * { opacity: 1 !important; transform: none !important; }

/* give the responsive SVG a fixed box so it renders in the canvas */
.pdf-rendering .radar-wrap { grid-template-columns: 1fr !important; }
.pdf-rendering .radar-svg { width: 460px !important; height: 356px !important; }
/* Right padding keeps the legend scores off the capture edge; without it the
   flush-right "3/4" values get their last glyph clipped by the page crop. */
.pdf-rendering .radar-legend { padding-right: 12px !important; }

/* the on-screen toggle shows one list; in the PDF show both, separated */
.pdf-rendering #rec-toggle,
.pdf-rendering #programme-list,
.pdf-rendering #programmes-sub,
.pdf-rendering #secondary-block { display: none !important; }
.pdf-rendering #programmes-print { display: block !important; }

/* The tools showcase is screen-only; the PDF leads with the four core pages. */
.pdf-rendering .pdf-hide { display: none !important; }
