@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --ink: #17211f;
  --muted: #68716f;
  --paper: #f4f1ea;
  --card: #fffdf8;
  --line: #d8d6cf;
  --thinking: #247e89;
  --sharing: #d96f62;
  --doing: #c89a38;
  --accent: #1d514d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 12% 8%, rgba(36, 126, 137, .08), transparent 28rem), var(--paper);
  font-family: "DM Sans", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
.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; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 88px;
  padding: 14px clamp(20px, 5vw, 76px);
  border-bottom: 1px solid rgba(23, 33, 31, .12);
  background: rgba(244, 241, 234, .9);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--ink); font-family: "Manrope", sans-serif; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: white; background: var(--accent); }
.step-switcher { display: flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.52); }
.step-button { padding: 9px 16px; border: 0; border-radius: 99px; color: var(--muted); background: transparent; cursor: pointer; }
.step-button span { margin-right: 6px; font-size: .7rem; }
.step-button.is-active { color: white; background: var(--ink); }
.header-progress { justify-self: end; width: min(170px, 100%); color: var(--muted); font-size: .75rem; text-align: right; }
.progress-track { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 250ms ease; }

main { min-height: calc(100vh - 160px); }
.view { display: none; width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: clamp(48px, 8vw, 110px) 0 80px; }
.view.is-active { display: block; animation: reveal 350ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.hero, .results-heading { display: grid; grid-template-columns: 1.25fr .75fr; gap: 8vw; align-items: end; margin-bottom: 72px; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-family: "Manrope", sans-serif; font-size: clamp(2.7rem, 6vw, 5.7rem); line-height: .98; letter-spacing: -.055em; }
h1 em { color: var(--accent); font-family: Georgia, serif; font-weight: 400; }
.hero-copy, .results-intro { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.score-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 26px; }
.score-key span { font-size: .72rem; line-height: 1.25; }
.score-key b { display: grid; width: 34px; height: 34px; margin-bottom: 8px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--card); font-size: .9rem; }

.assessment-layout { display: grid; grid-template-columns: 250px 1fr; gap: clamp(30px, 5vw, 76px); align-items: start; }
.summary-card { position: sticky; top: 120px; padding: 24px; border: 1px solid var(--line); background: rgba(255,253,248,.8); }
.name-field span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .76rem; font-weight: 600; }
.name-field input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: white; }
.name-field input:focus { border-color: var(--accent); outline: 2px solid rgba(29,81,77,.12); }
.name-field input.has-error { border-color: var(--sharing); }
.score-heading { margin-top: 30px; }
.mini-score { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); }
.mini-score strong { font-family: "Manrope", sans-serif; font-size: 2rem; }
.mini-score.thinking strong { color: var(--thinking); }
.mini-score.sharing strong { color: var(--sharing); }
.mini-score.doing strong { color: var(--doing); }
.summary-note { margin: 18px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }

.question-list { display: grid; gap: 14px; }
.question-block { display: grid; grid-template-columns: 80px 1fr; min-width: 0; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--card); transition: border-color 180ms ease, box-shadow 180ms ease; }
.question-block.is-complete { border-color: rgba(29,81,77,.45); }
.question-block.has-error { border-color: var(--sharing); box-shadow: 0 0 0 3px rgba(217,111,98,.12); }
.block-number { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--muted); font-family: "Manrope", sans-serif; font-size: 1.35rem; }
.block-content { padding: 12px 24px; }
.behavior-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; min-height: 66px; border-bottom: 1px solid var(--line); }
.behavior-row:last-child { border: 0; }
.behavior-name { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.behavior-name small, .result-score small { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: var(--muted); background: #efede7; font-size: .67rem; font-weight: 700; }
.score-options { display: flex; gap: 8px; }
.score-options label { position: relative; cursor: pointer; }
.score-options input { position: absolute; opacity: 0; pointer-events: none; }
.score-options span { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; transition: 150ms ease; }
.score-options input:hover + span, .score-options input:focus-visible + span { border-color: var(--accent); transform: translateY(-1px); }
.score-options input:checked + span { border-color: var(--ink); color: white; background: var(--ink); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 34px; }
.form-status { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.text-button { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; cursor: pointer; font-size: .8rem; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 26px; min-height: 52px; padding: 0 22px; border: 1px solid var(--ink); cursor: pointer; font-weight: 600; }
.primary-button { color: white; background: var(--ink); }
.primary-button:hover { background: var(--accent); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.secondary-button { background: transparent; }

.results-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 28px; }
.chart-card, .result-panel { border: 1px solid var(--line); background: var(--card); }
.chart-card { position: relative; min-height: 650px; padding: 24px; }
.chart-legend { position: absolute; top: 22px; left: 26px; display: flex; gap: 18px; color: var(--muted); font-size: .75rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 50%; }
.thinking-dot { background: var(--thinking); }
.sharing-dot { background: var(--sharing); }
.doing-dot { background: var(--doing); }
#ddd-chart { width: 100%; height: 100%; overflow: visible; }
#score-shape { fill: rgba(29,81,77,.34); stroke: var(--accent); stroke-linejoin: round; stroke-width: 4; transition: 400ms ease; }
.result-panel { display: flex; flex-direction: column; padding: clamp(24px, 4vw, 46px); }
.participant-result { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.participant-result strong { color: var(--ink); }
.result-score { display: grid; grid-template-columns: 1fr auto; gap: 14px 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.result-score > div:first-child { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.result-score strong { font-family: "Manrope", sans-serif; font-size: 2.5rem; }
.result-bar { grid-column: 1 / -1; height: 5px; overflow: hidden; background: #e9e6df; }
.result-bar span { display: block; width: 0; height: 100%; transition: width 500ms ease; }
.thinking .result-bar span { background: var(--thinking); }
.sharing .result-bar span { background: var(--sharing); }
.doing .result-bar span { background: var(--doing); }
.interpretation { flex: 1; padding: 38px 0; }
.interpretation h2 { margin: 0 0 12px; font-family: "Manrope", sans-serif; font-size: 1.8rem; letter-spacing: -.04em; }
.interpretation p { color: var(--muted); line-height: 1.65; }
.save-status { min-height: 1.4em; font-size: .78rem; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
footer { display: flex; justify-content: space-between; padding: 28px clamp(20px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
footer a { color: inherit; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-progress { display: none; }
  .hero, .results-heading { grid-template-columns: 1fr; gap: 28px; }
  .assessment-layout, .results-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}
@media (max-width: 620px) {
  .site-header { min-height: 72px; }
  .brand > span:last-child { display: none; }
  .step-button { padding: 8px 10px; }
  .view { width: min(100% - 24px, 1380px); padding-top: 44px; }
  .hero, .results-heading { margin-bottom: 40px; }
  .question-block { grid-template-columns: 46px 1fr; }
  .block-content { padding: 8px 14px; }
  .behavior-row { grid-template-columns: 1fr; gap: 8px; padding: 13px 0; }
  .score-options { justify-content: flex-start; }
  .form-footer, footer { align-items: flex-start; flex-direction: column; }
  .primary-button { width: 100%; }
  .chart-card { min-height: 440px; padding: 8px; }
  .chart-legend { position: static; padding: 10px; }
  .result-actions { grid-template-columns: 1fr; }
}
