/* Plywood Compass page — builds on main.css (tokens, header, footer, buttons).
   Spec: docs/09_PLYWOOD_COMPASS_SPEC.md */

/* ---------- Section head with the moving dial ---------- */
.cp-head { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .cp-head { grid-template-columns: minmax(0, 1fr) 180px; gap: 48px; } }
.cp-head__copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cp-dial { width: 200px; aspect-ratio: 1; justify-self: end; border-radius: 50%; box-shadow: 0 10px 26px rgba(49, 15, 2, 0.12), 0 0 0 1px rgba(49, 15, 2, 0.06); }
@media (max-width: 899px) { .cp-dial { display: none; } }
@media (min-width: 900px) { .cp-head { grid-template-columns: minmax(0, 1fr) 200px; } }
/* Needle points towards north as the visitor answers; the bezel turns the other way */
.cp-dial .rose__needle {
  transform: rotate(var(--needle, -120deg));
  transition: transform 1.2s cubic-bezier(.34, 1.5, .64, 1);
}
.cp-dial .rose__bezel {
  transform: rotate(calc(var(--needle, -120deg) * -0.35));
  transition: transform 1.6s cubic-bezier(.22, .7, .25, 1);
}
@media (prefers-reduced-motion: reduce) { .cp-dial .rose__needle, .cp-dial .rose__bezel { transition: none; } }

/* ---------- Progress ---------- */
.cp-tool[hidden] { display: none; }
.cp-progress { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cp-progress__label { font-size: 15px; font-weight: 600; min-width: 9em; }
.cp-progress__bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex: 1 1 200px; max-width: 360px; }
.cp-progress__bar span { height: 6px; border-radius: 3px; background: var(--rb-sand); transition: background-color .3s ease; }
.cp-progress__bar span.is-done { background: var(--rb-coffee); }
.cp-reset { background: none; border: 0; padding: 8px 0; font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* ---------- Steps ---------- */
.cp-tool { display: flex; flex-direction: column; gap: 20px; }
.cp-step {
  border: 1px solid var(--rb-line); border-radius: var(--r-xl); padding: clamp(20px, 3vw, 32px);
  margin: 0; min-width: 0; background: var(--rb-white);
  display: flex; flex-direction: column; gap: 18px;
  scroll-margin-top: 96px;
}
.cp-step[hidden] { display: none; }
.cp-step legend { padding: 0; font-size: clamp(20px, 2.2vw, 24px); font-weight: 600; display: flex; align-items: center; gap: 12px; float: left; width: 100%; }
.cp-step legend + * { clear: both; }
.cp-step__num { width: 32px; height: 32px; border-radius: 50%; background: var(--rb-coffee); color: var(--rb-white); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; font-variant-numeric: tabular-nums; }
.cp-step__hint { font-size: 15px; color: var(--rb-coffee-75); }
.cp-sub { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

/* Choice cards (radio inputs) */
.cp-choices { display: grid; gap: 12px; }
.cp-choices--spaces { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 600px) { .cp-choices--spaces { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cp-choices--spaces { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cp-choices--parts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.cp-choice { position: relative; display: block; }
.cp-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cp-choice span.cp-card {
  display: flex; align-items: center; gap: 14px; min-height: 64px; height: 100%;
  padding: 14px 16px; border: 1.5px solid var(--rb-line); border-radius: var(--r-lg);
  font-size: 16px; font-weight: 500; line-height: 1.35; background: var(--rb-white);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.cp-choices--spaces .cp-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; min-height: 120px; }
.cp-card__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--rb-grey); display: flex; align-items: center; justify-content: center; flex: none; }
.cp-card__icon svg { width: 22px; height: 22px; stroke: var(--rb-coffee); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cp-choice input:hover + .cp-card { border-color: var(--rb-coffee-75); }
.cp-choice input:checked + .cp-card { border: 2px solid var(--rb-coffee); background: var(--rb-grey); font-weight: 600; box-shadow: var(--shadow-soft); }
.cp-choice input:checked + .cp-card .cp-card__icon { background: var(--rb-white); }
.cp-choice input:focus-visible + .cp-card { outline: 2px solid var(--rb-coffee); outline-offset: 3px; }

/* Pills (finish, budget) */
.cp-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-pill { position: relative; }
.cp-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cp-pill span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--rb-line); font-size: 15px; font-weight: 500; background: var(--rb-white);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.cp-pill input:hover + span { border-color: var(--rb-coffee-75); }
.cp-pill input:checked + span { background: var(--rb-coffee); border-color: var(--rb-coffee); color: var(--rb-white); font-weight: 600; }
.cp-pill input:focus-visible + span { outline: 2px solid var(--rb-coffee); outline-offset: 3px; }
.cp-step3 { display: grid; gap: 22px; }
@media (min-width: 900px) { .cp-step3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.cp-show { align-self: flex-start; }

/* ---------- Result ---------- */
.cp-result {
  border-radius: var(--r-xl); background: var(--rb-white); border: 2px solid var(--rb-coffee);
  padding: clamp(22px, 3.4vw, 40px); display: flex; flex-direction: column; gap: 24px;
  scroll-margin-top: 96px; box-shadow: var(--shadow-lift);
}
.cp-result[hidden] { display: none; }
.cp-result__head { display: flex; flex-direction: column; gap: 12px; }
.cp-result__context { font-size: 15px; color: var(--rb-coffee-75); }
.cp-result__board { font-size: clamp(28px, 4vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.cp-result__grid { display: grid; gap: 18px 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cp-fact { display: flex; flex-direction: column; gap: 4px; }
.cp-fact dt { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.cp-fact dd { margin: 0; font-size: 16px; line-height: 1.55; }
.cp-fact--advice { background: var(--rb-grey); border-radius: var(--r-lg); padding: 16px 18px; }
.cp-fact--advice dt { display: flex; align-items: center; gap: 8px; }
.cp-fact--advice .needle { width: 10px; height: 8px; }
.cp-result__note { font-size: 14px; color: var(--rb-coffee-75); border-top: 1px solid var(--rb-line); padding-top: 16px; }
.cp-result__actions .btn--outline { font-size: 16px; }
.cp-result.is-new { animation: cp-in .5s ease-out both; }
@keyframes cp-in { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cp-result.is-new { animation: none; } }

.cp-noscript { border: 1px dashed var(--rb-coffee-75); border-radius: var(--r-lg); padding: 18px; }
