/* Fit check: one slope vs Slope-IQ Best-Fit on the sample survey. Markup: [data-fitc];
   behaviour: assets/fit-check.js. A dark card in the Auto-Nudge explainer's drawing style
   (soil, cream lines, Caveat notes); it sits on light or dark sections alike. */

.fitc {
  display: grid; gap: 12px;
  padding: clamp(10px, 1.4vw, 16px);
  border-radius: 18px;
  background: #1a1612;
  color: #f3ece0;
  box-shadow: 0 30px 70px rgba(26, 22, 18, .18);
}

/* the two designs: a segmented switch, with a progress bar while it alternates on its own */
.fitc__bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border-radius: 12px;
  background: rgba(243, 236, 224, .07);
}
.fitc__btn {
  position: relative; overflow: hidden;
  min-height: 44px; padding: 8px 12px;
  border: 0; border-radius: 9px;
  background: transparent; color: #d8cfbc;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.fitc__btn:hover:not(.is-on) { background: rgba(243, 236, 224, .06); color: #fff; }
.fitc__btn.is-on { background: #f3ece0; color: #1a1612; }
.fitc__btn:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.fitc__tick { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; border-radius: 2px; background: transparent; }
.fitc__tick::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--brand-green); border-radius: inherit; }
.fitc.is-ticking .fitc__btn.is-on .fitc__tick::after { animation: fitc-tick var(--fitc-dur, 5s) linear both; }
@keyframes fitc-tick { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* the profile */
.fitc__stage {
  margin: 0;
  border-radius: 12px;
  background: #221d18;
  border: 1px solid rgba(243, 236, 224, .12);
  overflow: hidden;
}
.fitc__svg { display: block; width: 100%; height: auto; }
.fitc-soil { fill: #2e261e; }
.fitc-hatch-bg { fill: rgba(226, 110, 27, .2); }
.fitc-hatch-line { stroke: #e26e1b; stroke-opacity: .75; stroke-width: 1.6; }
.fitc-fill { fill: rgba(40, 140, 39, .55); }
.fitc-ground { fill: none; stroke: #d9cfbf; stroke-width: 2; stroke-linejoin: round; }
.fitc-design { fill: none; stroke: #fff; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.fitc-ends circle { fill: #fff; }
.fitc-dim path { fill: none; stroke: #f3ece0; stroke-width: 1.4; }
.fitc-note { font-family: "Caveat", "Segoe Print", cursive; font-size: 23px; font-weight: 600; fill: #f3ece0; paint-order: stroke; stroke: #221d18; stroke-width: 5px; stroke-linejoin: round; }
.fitc-note--fill { fill: #9be197; transition: opacity .35s ease; }
.fitc-axis { font: 700 11px/1 var(--font-sans, "Open Sans", system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; fill: rgba(243, 236, 224, .55); }
.fitc.is-narrow .fitc-note { font-size: 20px; stroke-width: 4.5px; }

/* the numbers, both designs side by side */
.fitc__read { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fitc__read th, .fitc__read td { padding: 8px 10px; text-align: right; }
.fitc__read thead th { font-size: 12px; font-weight: 700; color: rgba(243, 236, 224, .6); vertical-align: bottom; line-height: 1.25; text-wrap: balance; }
.fitc__read tbody th { text-align: left; font-weight: 600; color: rgba(243, 236, 224, .7); }
.fitc__read tbody td { font-weight: 700; color: rgba(243, 236, 224, .6); transition: color .3s ease, background .3s ease; }
.fitc__read tbody tr + tr > * { border-top: 1px solid rgba(243, 236, 224, .1); }
.fitc__read .is-on { background: rgba(243, 236, 224, .07); color: #fff; }
.fitc__read thead .is-on { color: #fff; border-radius: 8px 8px 0 0; }
.fitc__read tbody tr:last-child .is-on { border-radius: 0 0 8px 8px; }
.fitc__read tr > :first-child { width: 34%; }

.fitc__cap { margin: 0 4px 2px; font-size: 12.5px; line-height: 1.45; color: rgba(243, 236, 224, .55); }
.fitc .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* in a feature-hero (modes/ditching.html): the heading comes first once the columns stack */
@media (max-width: 800px) { .fitc-col { order: 2; } }
@media (max-width: 480px) {
  .fitc { border-radius: 14px; }
  .fitc__btn { font-size: 14px; padding: 8px; }
  .fitc__read { font-size: 13px; }
  .fitc__read th, .fitc__read td { padding: 7px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .fitc__btn, .fitc__read tbody td, .fitc-note--fill { transition: none; }
}
html.da-still .fitc__btn, html.da-still .fitc__read tbody td, html.da-still .fitc-note--fill { transition: none; }
