/* ==========================================================================
   Fit — one interactive "what I do / what I don't" comparison
   ========================================================================== */
.fit {
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
}

.fit__head {
  max-width: 68ch;
  margin: 0 auto clamp(1.15rem, 2.5vw, 1.7rem);
  text-align: center;
}

.fit__title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  color: var(--colour-text);
}

.fit__intro {
  margin-top: 0.95rem;
  color: var(--colour-muted);
  font-size: 1.05rem;
}

.fit__comparison {
  width: 100%;
  margin-inline: auto;
}

.fit__switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 300px);
  margin: 0 auto 1.35rem;
  padding: 3px;
  background: #f1ece2;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  box-shadow: none;
}

.fit__switch::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 3px auto 3px 3px;
  width: calc(50% - 3px);
  box-sizing: border-box;
  border-radius: 999px;
  background-color: var(--postit-green);
  border: 1px solid rgba(39, 72, 33, 0.28);
  box-shadow: none;
  transform: translateX(0);
}

.fit__switch.is-dont::before {
  background-color: var(--postit-pink);
  border-color: rgba(138, 59, 77, 0.28);
  transform: translateX(100%);
}

.fit__switch-button {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 0.58rem 0.85rem;
  cursor: pointer;
  color: #1a1a1a;
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.06s ease, filter 0.12s ease;
}

.fit__switch-button:hover,
.fit__switch-button:focus {
  filter: brightness(1.04);
}

.fit__switch-button:active {
  transform: none;
  box-shadow: none;
}

.fit__switch-button:focus-visible {
  outline: 3px solid rgba(30, 122, 84, 0.5);
  outline-offset: 2px;
}

.fit__switch-button.is-active {
  text-shadow: none;
}

.fit__switch-button--do.is-active { color: #274821; }
.fit__switch-button--dont.is-active { color: #8a3b4d; }

.fit__switch-button:not(.is-active) {
  color: #746f66;
  text-shadow: none;
}

.fit__stage {
  position: relative;
}

.fit__panel[hidden] {
  display: none;
}

.fit__viewport {
  overflow: hidden;
}

.fit__list {
  --fit-per: 3;
  --fit-gap: clamp(1rem, 2vw, 1.5rem);
  display: flex;
  gap: var(--fit-gap);
  overflow-x: auto;
  padding-bottom: 2px;
  list-style: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.fit__list::-webkit-scrollbar {
  display: none;
}

.fit__item {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 calc((100% - (var(--fit-per) - 1) * var(--fit-gap)) / var(--fit-per));
  min-height: 11.5rem;
  padding: 4.2rem 1.3rem 1.3rem;
  color: var(--colour-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  scroll-snap-align: start;
  text-align: center;
}

.fit__item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3.15rem;
  background: var(--fit-band);
}

.fit__item::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.65rem;
  width: 28px;
  height: 28px;
  background: var(--fit-mark-colour);
  transform: translateX(-50%);
  -webkit-mask: var(--fit-mark) center / contain no-repeat;
  mask: var(--fit-mark) center / contain no-repeat;
}

.fit__panel--do {
  --fit-band: var(--postit-green);
  --fit-mark-colour: #274821;
  --fit-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z'/%3E%3C/svg%3E");
}

.fit__panel--dont {
  --fit-band: var(--postit-pink);
  --fit-mark-colour: #8a3b4d;
  --fit-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z'/%3E%3C/svg%3E");
}

.fit__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.fit__arrow {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  cursor: pointer;
  color: var(--colour-text);
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  box-shadow: 0 2px 6px -3px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s ease, background 0.2s ease;
}

.fit__arrow::before {
  font-size: 1.25rem;
  line-height: 1;
}

.fit__arrow--prev::before { content: "\2190"; }
.fit__arrow--next::before { content: "\2192"; }

.fit__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.fit__arrow:not(:disabled):hover {
  background: color-mix(in srgb, var(--card) 88%, var(--colour-accent));
}

.fit__arrow:focus-visible {
  outline: 3px solid rgba(30, 122, 84, 0.5);
  outline-offset: 2px;
}

.fit__count {
  min-width: 3.5rem;
  color: var(--colour-text);
  font-size: 0.94rem;
  font-weight: 700;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .fit__switch::before {
    transition:
      transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
      background-color 0.38s cubic-bezier(0.4, 0, 0.2, 1),
      border-color 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .fit__panel:not([hidden]) {
    animation: fit-face-in 0.22s ease-out;
  }

  @keyframes fit-face-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 1200px) {
  .fit__list {
    --fit-per: 2;
  }
}

@media (max-width: 640px) {
  .fit__list {
    --fit-per: 1;
    scroll-padding-left: 0;
  }
}

@media (max-width: 560px) {
  .fit__switch-button {
    padding-inline: 0.65rem;
  }
}
