:root {
  --paper: #ECEEE7;
  --paper-2: #E2E6DC;
  --ink: #18332F;
  --ink-soft: #3E5752;
  --moss: #4F6B4C;
  --ochre: #B98A2E;
  --plum: #5D3354;
  --mist: #D5DBD0;
  --white: #F8F9F5;
  --serif: "Spectral", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}
a { color: var(--moss); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.shell { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem 5rem; }

.masthead {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.5rem 0 1rem; font-family: var(--sans); font-size: .9rem; color: var(--ink-soft);
}
.masthead strong { color: var(--ink); font-weight: 600; letter-spacing: .01em; }
.masthead a { color: inherit; text-decoration: none; }

/* Welcome */
.hero { padding: 3rem 0 2rem; position: relative; }
.hero h1 {
  font-weight: 300; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.02;
  letter-spacing: -.02em; margin: 0 0 1.5rem; max-width: 12ch;
}
.hero .lede { font-size: 1.3rem; line-height: 1.5; max-width: var(--measure); color: var(--ink-soft); margin: 0 0 2rem; }
.hero-roots { display: block; width: 100%; height: auto; margin: 1rem 0 2.5rem; }
.hero-roots path { fill: none; stroke: var(--moss); stroke-width: 1.6; stroke-linecap: round; }
.hero-roots .ground { stroke: var(--ink); stroke-width: 2; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 2.5rem 0; font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); }
.facts b { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 400; color: var(--ink); }
.prose p { max-width: var(--measure); }
.prose h2, h2 { font-weight: 400; font-size: 1.75rem; line-height: 1.2; margin: 2.5rem 0 .75rem; letter-spacing: -.01em; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: .95rem 1.6rem; border-radius: 999px;
  background: var(--ink); color: var(--white);
  transition: background .2s;
}
.btn:hover { background: var(--moss); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.quiet:hover { background: var(--paper-2); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 2rem; }

/* Forms */
form.intake { max-width: var(--measure); }
.field { margin: 0 0 1.4rem; }
.field label, .field .label { display: block; font-family: var(--sans); font-size: .95rem; font-weight: 600; margin-bottom: .4rem; }
.field .hint { font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); margin: -.2rem 0 .45rem; }
.field input[type=text], .field input[type=email], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  padding: .75rem .9rem; border: 1.5px solid var(--mist); border-radius: 10px; background: var(--white);
}
.field input:focus, .field select:focus { border-color: var(--moss); outline: none; box-shadow: 0 0 0 3px rgba(79,107,76,.2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.choice { display: grid; gap: .6rem; }
.choice label {
  display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px;
  background: var(--white); border: 1.5px solid var(--mist); cursor: pointer; font-family: var(--sans); font-weight: 400; font-size: 1rem; margin: 0;
}
.choice label:has(input:checked) { border-color: var(--ink); background: var(--paper-2); }
.choice input { margin-top: .3rem; accent-color: var(--ink); }
.choice small { display: block; color: var(--ink-soft); font-size: .88rem; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-family: var(--sans); font-size: .92rem; line-height: 1.45; margin: .9rem 0; }
.consent input { margin-top: .25rem; accent-color: var(--ink); width: 1.05rem; height: 1.05rem; flex: none; }
.error { font-family: var(--sans); font-size: .92rem; color: #8A2E2E; margin: .4rem 0 0; }
.team-ok { font-family: var(--sans); font-size: .92rem; color: var(--moss); margin: .4rem 0 0; }

/* Questions */
.q-wrap { min-height: 70vh; display: flex; flex-direction: column; padding-top: 2rem; }
.progress { height: 3px; background: var(--mist); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--moss); transition: width .35s ease; }
.q-meta { display: flex; justify-content: space-between; font-family: var(--sans); font-size: .88rem; color: var(--ink-soft); margin: .7rem 0 3rem; }
.q-text { font-weight: 300; font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.22; letter-spacing: -.01em; margin: 0 0 2.5rem; max-width: 22ch; min-height: 4.6em; }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.scale button {
  appearance: none; cursor: pointer; border: 1.5px solid var(--mist); background: var(--white); color: var(--ink);
  border-radius: 14px; padding: 1rem .4rem .85rem; font-family: var(--sans); font-size: .82rem; line-height: 1.25;
  display: flex; flex-direction: column; align-items: center; gap: .45rem; transition: border-color .15s, background .15s;
}
.scale button .dot { width: .9rem; height: .9rem; border-radius: 50%; border: 1.5px solid var(--ink-soft); }
.scale button:hover { border-color: var(--moss); }
.scale button[aria-pressed=true] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.scale button[aria-pressed=true] .dot { background: var(--ochre); border-color: var(--ochre); }
.q-nav { display: flex; justify-content: space-between; margin-top: 2rem; font-family: var(--sans); }
.linkish { appearance: none; background: none; border: 0; cursor: pointer; font: inherit; font-size: .95rem; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; padding: .4rem 0; }
.keyhint { font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); margin-top: auto; padding-top: 3rem; }

/* Report */
.report-head { padding: 2.5rem 0 1rem; }
.report-head .for { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); margin: 0 0 .6rem; }
.report-head h1 { font-weight: 300; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 1rem; max-width: 18ch; }
.report-head .summary { font-size: 1.25rem; color: var(--ink-soft); max-width: var(--measure); }

.rootmap { margin: 1.5rem -0.5rem 1rem; }
.rootmap svg { width: 100%; height: auto; display: block; overflow: visible; }
.rootmap .ground { fill: var(--paper-2); }
.rootmap .surface { stroke: var(--ink); stroke-width: 2; }
.rootmap .root { fill: none; stroke: var(--moss); stroke-width: 3; stroke-linecap: round; }
.rootmap .twig { fill: none; stroke: var(--moss); stroke-width: 1.4; stroke-linecap: round; opacity: .7; }
.rootmap .tip { fill: var(--ochre); }
.rootmap .range { stroke: var(--ochre); stroke-width: 12; stroke-linecap: round; opacity: .22; }
.rootmap .depth { stroke: var(--mist); stroke-width: 1; stroke-dasharray: 2 5; }
.rootmap .depthlabel { font-family: var(--sans); font-size: 11px; fill: var(--ink-soft); }
.rootmap .dimname { font-family: var(--sans); font-size: 13px; font-weight: 600; fill: var(--ink); }
.rootmap .dimscore { font-family: var(--serif); font-size: 20px; fill: var(--ink); }
.rootmap svg.narrow .dimname { font-size: 10.5px; }
.rootmap .bandname { font-family: var(--sans); font-size: 11px; fill: var(--ink-soft); }
@media (prefers-reduced-motion: no-preference) {
  .rootmap.animate .root, .rootmap.animate .twig { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: grow 1.6s cubic-bezier(.3,.6,.2,1) forwards; animation-delay: var(--delay); }
  .rootmap.animate .range { opacity: 0; animation: appearSoft .6s ease forwards; animation-delay: calc(var(--delay) + 1.3s); }
  .rootmap.animate .tip, .rootmap.animate .tiplabel { opacity: 0; animation: appear .4s ease forwards; animation-delay: calc(var(--delay) + 1.3s); }
}
@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes appearSoft { to { opacity: .22; } }
.caption { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); max-width: var(--measure); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2.5rem 0; }
.pair h3 { font-family: var(--sans); font-size: .95rem; font-weight: 600; margin: 0 0 .3rem; color: var(--ink-soft); }
.pair .name { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; }
.pair p { margin: 0; font-size: 1.02rem; }

.pattern { border-left: 4px solid var(--plum); padding: .2rem 0 .2rem 1.4rem; margin: 2rem 0 2.5rem; max-width: 40rem; }
.pattern .root-tag { font-family: var(--sans); font-size: .88rem; color: var(--plum); margin: 0 0 .2rem; }
.pattern h3 { font-weight: 400; font-size: 1.7rem; margin: 0 0 .6rem; line-height: 1.15; }
.pattern blockquote { margin: 0 0 1rem; font-style: italic; font-size: 1.2rem; color: var(--plum); }
.pattern .seen { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); }
.calm { background: var(--white); border-radius: 16px; padding: 1.4rem 1.6rem; max-width: 40rem; }

.dimlist { margin: 1rem 0 0; }
.dim { padding: 1.4rem 0; border-top: 1px solid var(--mist); display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; }
.dim:last-child { border-bottom: 1px solid var(--mist); }
.dim .score { font-size: 2.2rem; line-height: 1; font-weight: 300; }
.dim .score small { display: block; font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); margin-top: .4rem; }
.dim h3 { font-weight: 400; font-size: 1.35rem; margin: 0 0 .2rem; }
.dim .q { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); margin: 0 0 .6rem; }
.dim p { margin: 0; font-size: 1.02rem; }
.dim .split { font-family: var(--sans); font-size: .88rem; color: var(--plum); margin-top: .6rem; }

ol.plan { list-style: none; padding: 0; max-width: var(--measure); counter-reset: step; }
ol.plan li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1rem; }
ol.plan li::before { content: counter(step); position: absolute; left: 0; top: .1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--moss); color: var(--white); font-family: var(--sans); font-size: .9rem; font-weight: 600; display: grid; place-items: center; }

.next { margin: 3rem 0 1rem; padding: 2rem; background: var(--ink); color: var(--white); border-radius: 22px; }
.next h2 { margin-top: 0; color: var(--white); }
.next p { max-width: 34rem; color: #D6E0DA; }
.next .btn { background: var(--ochre); color: var(--ink); }
.next .btn:hover { background: #CFA143; }
.next .btn.quiet { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px #8FA7A0; }

.linkbox { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); margin-top: 1.5rem; max-width: var(--measure); }
.linkbox code { word-break: break-all; background: var(--white); padding: .1rem .35rem; border-radius: 6px; }

.footer { font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--mist); display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.footer a { color: inherit; }

.center-msg { padding: 6rem 0; max-width: var(--measure); }
.spinner { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid var(--mist); border-top-color: var(--moss); animation: spin 1s linear infinite; margin-bottom: 1.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  body { font-size: 1.06rem; }
  .masthead { flex-direction: column; gap: .1rem; }
  .facts { grid-template-columns: 1fr; gap: 1rem; }
  .two, .pair { grid-template-columns: 1fr; }
  .scale { grid-template-columns: 1fr; }
  .scale button { flex-direction: row; justify-content: flex-start; padding: .85rem 1rem; font-size: .95rem; }
  .dim { grid-template-columns: 1fr; gap: .6rem; }
  .next { padding: 1.5rem; }
  .keyhint { display: none; }
  .q-text { min-height: 0; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .masthead a, .actions, .next .actions, .linkbox, .footer nav, .no-print { display: none !important; }
  .next { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
  .next h2, .next p { color: var(--ink); }
  .rootmap .root, .rootmap .twig { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; animation: none !important; }
  .rootmap .tip, .rootmap .tiplabel { opacity: 1 !important; animation: none !important; }
  .rootmap .range { opacity: .22 !important; animation: none !important; }
  .pattern, .dim, .pair { break-inside: avoid; }
}
