/* ==============================================================
   SOFTENING · page styles
   File: /softening/softening.css
   Colours, font and buttons come from site.css.
   The "How it helps" section uses shared styles (site.css, section 13).

   Sections:
     1  Figure colours
     2  The room (intro and layout)
     3  Guidance and the figure
     4  Controls
   ============================================================== */


/* --------------------------------------------------------------
   1 · FIGURE COLOURS
   rest: waiting · tense: squeezing · release: letting go · done: softened
   -------------------------------------------------------------- */
:root {
  --body-rest: #D3DBD7;
  --body-still: #E2E7E4;
  --body-edge: #B4C0BB;
  --body-tense: #E3A05C;
  --body-release: #8FC3CA;
  --body-done: #B9D2BF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --body-rest: #3C4B52;
    --body-still: #33414A;
    --body-edge: #52646C;
    --body-tense: #D9914A;
    --body-release: #6FA7AF;
    --body-done: #5E8466;
  }
}


/* --------------------------------------------------------------
   2 · THE ROOM
   -------------------------------------------------------------- */
.softroom {
  padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(3rem, 8vw, 5.5rem);
  background: linear-gradient(var(--c-sky-top), color-mix(in srgb, var(--c-sky-bottom) 60%, var(--bg)));
}
.softroom__inner {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.softroom__intro {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}
.softroom__title {
  margin-bottom: .45em;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  font-weight: var(--weight-light);
  letter-spacing: -.025em;
}
.softroom__lede {
  margin-bottom: 1rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  line-height: 1.45;
}
.softroom__note { color: var(--muted); font-size: 1rem; }
.softroom__work { max-width: 38rem; }

@media (max-width: 900px) {
  .softroom__inner { grid-template-columns: 1fr; }
  .softroom__intro { position: static; }
}


/* --------------------------------------------------------------
   3 · GUIDANCE AND THE FIGURE
   -------------------------------------------------------------- */
.soft-guide {
  min-height: 7.4rem;
  margin-bottom: .5rem;
  text-align: center;
}
.soft-guide__area {
  font-size: var(--step-2);
  font-weight: var(--weight-light);
  line-height: 1.15;
}
.soft-guide__do {
  max-width: 30rem;
  margin: .4rem auto 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.soft-guide__bar {
  width: min(14rem, 60%);
  height: 4px;
  margin: .8rem auto 0;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  opacity: 0;
  transition: opacity .4s ease;
}
.soft-guide__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.is-running .soft-guide__bar { opacity: 1; }

.figure-stage {
  display: flex;
  justify-content: center;
}
.figure {
  display: block;
  width: auto;
  height: min(58svh, 30rem);
  overflow: visible;
}

.figure .part {
  fill: var(--body-rest);
  stroke: var(--body-edge);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 2.5s ease, transform .6s ease, opacity .6s ease;
}
.figure .part--still { fill: var(--body-still); }
.figure .part[data-area] { cursor: pointer; }
.figure .part[data-area]:hover { fill: color-mix(in srgb, var(--body-rest) 70%, var(--body-release)); }

/* Squeezing: warm, slightly smaller, gently pulsing */
.figure .part.is-tense {
  fill: var(--body-tense);
  filter: url(#warm-glow);
  transform: scale(.955);
  transition: fill .5s ease, transform .5s ease;
  animation: squeeze-pulse 1.2s ease-in-out infinite;
}
@keyframes squeeze-pulse {
  50% { opacity: .82; }
}

/* Letting go: cool colour spreads back in, size returns */
.figure .part.is-release { fill: var(--body-release); transform: scale(1.015); }
.figure .part.is-done { fill: var(--body-done); }

/* At the very end, the whole figure breathes softly once */
.figure.is-complete .part { fill: var(--body-done); }
.figure.is-complete { animation: whole-glow 3s ease-in-out 1; }
@keyframes whole-glow {
  50% { filter: drop-shadow(0 0 14px var(--body-release)); }
}

@media (prefers-reduced-motion: reduce) {
  .figure .part.is-tense { animation: none; transform: none; }
  .figure .part.is-release { transform: none; }
  .figure.is-complete { animation: none; }
}


/* --------------------------------------------------------------
   4 · CONTROLS
   -------------------------------------------------------------- */
.soft-panel {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.soft-panel:focus { outline: none; }

.soft-choice {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}
.soft-choice legend {
  padding: 0;
  margin-bottom: .6rem;
  font-weight: var(--weight-strong);
}
.soft-choice__row { display: flex; flex-wrap: wrap; gap: .5rem; }

.soft-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;
  padding: .45rem 1.1rem .45rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.soft-pill input { margin: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.soft-pill:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.soft-pill:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.soft-single-label {
  margin: 1.5rem 0 .6rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.soft-areas {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.soft-area-btn {
  appearance: none;
  min-height: 40px;
  padding: .35rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: var(--weight-regular) .95rem/1.2 var(--font-main);
  cursor: pointer;
}
.soft-area-btn:hover { border-color: var(--text); }

/* The list of areas during a session */
.soft-steps {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: .9rem;
}
.soft-steps li {
  padding: .3rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.soft-steps li[aria-current="step"] {
  border-color: var(--accent);
  color: var(--text);
  font-weight: var(--weight-strong);
}
.soft-steps li.is-done { background: color-mix(in srgb, var(--body-done) 45%, transparent); color: var(--text); }
.soft-steps li.is-skipped { text-decoration: line-through; }

.soft-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.soft-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.soft-status {
  min-height: 1.65em;
  margin-top: 1rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .soft-actions .btn { flex: 1 1 100%; }
}
