/* ==========================================================================
   LP03 · UNIT 6 · START FREE AND GROW AS YOU NEED — volume console
   --------------------------------------------------------------------------
   Centered copy above one wide "console": at inline-start a navy panel
   where a stack of invoice sheets grows with the volume; at inline-end a
   readout ("N documents per year"), a native range slider with the free
   threshold (100) marked, and two package tiles — Free package / A package
   that better fits your needs — the one matching the volume lights up.
   The left half of the track covers 0–100 documents, the right half
   100–1000+, so the free zone is easy to explore. No prices are shown.
   grow.js runs with or without motion (it is a tool, not decoration).
   ========================================================================== */

.grow {
  background:
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(0, 169, 182, 0.12), transparent 70%),
    linear-gradient(180deg, var(--c-cloud) 0%, var(--c-white) 100%);
}

/* soft rising wave behind the console — "grow as you need" */
.grow__wave {
  position: absolute;
  inset-inline-start: 30%;
  inset-inline-end: -10%;
  inset-block-end: 0;
  block-size: 60%;
  border-start-start-radius: 100% 100%;
  background: linear-gradient(180deg, rgba(0, 169, 182, 0.09), rgba(1, 62, 106, 0.04));
}

.grow__copy {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
  max-inline-size: 44rem;
  margin-inline: auto;
  margin-block-end: clamp(2rem, 5vw, 3rem);
}

/* ---------------------------------------------------------------------------
   Console
   --------------------------------------------------------------------------- */
.grow__console {
  display: grid;
  max-inline-size: 64rem;
  margin-inline: auto;
  border-radius: var(--r-panel);
  background-color: var(--c-white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

@media (min-width: 48rem) {
  .grow__console {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

/* ---- Paper stack panel --------------------------------------------------- */
.grow__stage {
  position: relative;
  display: grid;
  place-items: end center;
  min-block-size: 15rem;
  padding: 2rem 1.5rem;
  background:
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(0, 169, 182, 0.3), transparent 70%),
    var(--c-navy);
  transition: background-color 0.5s var(--ease-out);
  overflow: hidden;
}

.grow.is-beyond .grow__stage {
  background-color: var(--c-deep-teal);
}

.grow__stack {
  position: relative;
  inline-size: 7.5rem;
  block-size: 12rem;
}

.grow__sheet {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: calc(var(--i) * 0.6rem);
  inline-size: 100%;
  block-size: 3.25rem;
  border-radius: 6px;
  background-color: var(--c-white);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-1.25rem);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}

/* two text lines on every sheet */
.grow__sheet::before,
.grow__sheet::after {
  content: "";
  position: absolute;
  inset-inline-start: 0.6rem;
  block-size: 0.3rem;
  border-radius: var(--r-pill);
  background-color: rgba(11, 31, 68, 0.18);
}

.grow__sheet::before { inset-block-start: 0.7rem; inline-size: 55%; }
.grow__sheet::after  { inset-block-start: 1.35rem; inline-size: 35%; }

.grow__sheet.is-on {
  opacity: 1;
  transform: none;
}

/* sheets above the free threshold get a teal edge */
.grow__sheet.is-extra {
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.45), inset 3px 0 0 var(--c-teal);
}

/* growth arrow, appears beyond the free volume */
.grow__arrow {
  position: absolute;
  inset-block-start: 1.25rem;
  inset-inline-end: 1.25rem;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  color: var(--c-teal);
  opacity: 0.25;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.grow.is-beyond .grow__arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ---- Controls panel ------------------------------------------------------ */
.grow__panel {
  display: grid;
  gap: var(--space-lg);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.grow__readout {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  text-align: center;
}

@media (min-width: 48rem) {
  .grow__readout {
    justify-items: start;
    text-align: start;
  }
}

.grow__num {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}

.grow__unit {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--c-slate);
}

/* ---- Range slider -------------------------------------------------------- */
.grow__slider {
  position: relative;
  padding-block-end: 1.5rem;     /* room for the scale labels */
}

.grow__range {
  --pos: 25%;
  --fill-dir: to right;
  display: block;
  inline-size: 100%;
  block-size: 2.75rem;           /* 44px touch target */
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

[dir="rtl"] .grow__range {
  --fill-dir: to left;
}

.grow__range:focus {
  outline: none;
}

/* track: teal fill up to the thumb; free half tinted, paid half neutral */
.grow__range::-webkit-slider-runnable-track {
  block-size: 0.5rem;
  border-radius: var(--r-pill);
  background:
    linear-gradient(var(--fill-dir), var(--c-teal) var(--pos), transparent var(--pos)),
    linear-gradient(var(--fill-dir), rgba(0, 169, 182, 0.18) 50%, var(--c-ink-a10) 50%);
}

.grow__range::-moz-range-track {
  block-size: 0.5rem;
  border-radius: var(--r-pill);
  background:
    linear-gradient(var(--fill-dir), var(--c-teal) var(--pos), transparent var(--pos)),
    linear-gradient(var(--fill-dir), rgba(0, 169, 182, 0.18) 50%, var(--c-ink-a10) 50%);
}

.grow__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  margin-block-start: -0.625rem;
  border-radius: 50%;
  border: 4px solid var(--c-white);
  background-color: var(--c-navy);
  box-shadow: 0 0 0 1px var(--c-ink-a20), var(--shadow-md);
  transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}

.grow__range::-moz-range-thumb {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  border-radius: 50%;
  border: 4px solid var(--c-white);
  background-color: var(--c-navy);
  box-shadow: 0 0 0 1px var(--c-ink-a20), var(--shadow-md);
}

.grow__range:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.grow__range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(0, 169, 182, 0.35), var(--shadow-md);
}

.grow__range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(0, 169, 182, 0.35), var(--shadow-md);
}

/* scale: 0 · 100 (threshold mark) · 1000+ */
.grow__scale {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 1.25rem;
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--c-mist);
  font-variant-numeric: tabular-nums;
}

.grow__scale span {
  position: absolute;
  inset-block-end: 0;
}

.grow__scale span:nth-child(1) { inset-inline-start: 0; }
.grow__scale span:nth-child(3) { inset-inline-end: 0; }

.grow__scale span:nth-child(2) {
  inset-inline-start: 50%;
  translate: -50% 0;
  color: var(--c-deep-teal);
  font-weight: 700;
}

[dir="rtl"] .grow__scale span:nth-child(2) {
  translate: 50% 0;
}

/* tick above the 100 label */
.grow__scale span:nth-child(2)::before {
  content: "";
  position: absolute;
  inset-block-end: calc(100% + 0.3rem);
  inset-inline-start: 50%;
  inline-size: 2px;
  block-size: 0.9rem;
  border-radius: 2px;
  background-color: var(--c-deep-teal);
  translate: -50% 0;
}

/* ---- Package tiles ------------------------------------------------------- */
.grow__tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md);
}

.grow__tile {
  position: relative;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 1rem;
  border-radius: var(--r-card);
  border: 1px solid var(--c-ink-a10);
  background-color: var(--c-cloud);
  color: var(--c-slate);
  font-size: var(--fs-small);
  line-height: 1.4;
  transition: border-color 0.4s var(--ease-out), background-color 0.4s var(--ease-out),
              box-shadow 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.grow__tile b {
  font-family: var(--ff-display);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--c-ink);
  line-height: 1.3;
}

.grow__tile-icon {
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 10px;
  background-color: var(--c-white);
  color: var(--c-deep-teal);
  box-shadow: var(--shadow-sm);
}

.grow__tile-icon svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

.grow__tile.is-active {
  border-color: rgba(0, 169, 182, 0.6);
  background-color: var(--c-white);
  box-shadow: 0 0 0 4px rgba(0, 169, 182, 0.14), var(--shadow-md);
}

.grow__tile.is-active .grow__tile-icon {
  background-color: var(--c-teal);
  color: var(--c-navy);
}

/* "current" check on the active tile */
.grow__tile::after {
  content: "";
  position: absolute;
  inset-block-start: 0.875rem;
  inset-inline-end: 0.875rem;
  inline-size: 0.6rem;
  block-size: 0.6rem;
  border-radius: 50%;
  background-color: var(--c-ink-a20);
  transition: background-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.grow__tile.is-active::after {
  background-color: var(--c-teal);
  box-shadow: 0 0 0 4px rgba(0, 169, 182, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .grow__sheet,
  .grow__arrow,
  .grow__tile {
    transition: none;
  }
}

/* ---------------------------------------------------------------------------
   Section CTA (→ hero form)
   --------------------------------------------------------------------------- */
@media (min-width: 48rem) {
  .grow__cta {
    justify-content: flex-start;
  }
}
