/* Why HIMALA: the five problems set large on a stem, the comparison rows, the hidden costs.
   Still by default (the stem drawn, every node orange, every leaf open, every mark drawn); under html.anim (why.js) the stem draws itself as you scroll
   with the sprout on its tip, each problem rising into place as it passes, and each comparison row draws its marks as it scrolls into view. */
.why section > .wrap { padding-block: clamp(72px, 9vw, 128px); border-top: 1px solid var(--hair); }
.why .why-hero > .wrap { padding-block: calc(var(--nav-h) + clamp(56px, 8vw, 120px)) clamp(56px, 7vw, 96px); border-top: 0; }

/* ---------- Hero: the headline and lead, centred on desktop (the owner's call), nothing beside them ---------- */
.why-hero h1 { max-width: 14ch; }
.why-hero .lead { max-width: 46ch; margin-top: 32px; }
@media (min-width: 981px) {
  .why-hero h1, .why-hero .lead { margin-inline: auto; text-align: center; }
}


/* ---------- Five statements on a stem: the problem in Fraunces, the paragraph beneath ---------- */
/* the problems follow straight on from the hero: no hairline, a shorter gap, and their heading reads as a small label over the stem (the hero already made the statement) */
.why .why-problems > .wrap { padding-top: clamp(24px, 3vw, 40px); border-top: 0; }
.problems-label { font: 600 .8125rem/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* the stem list: why.js draws a stem through it (--line: where it runs, as a fraction of the list's width; --sway: its bend between nodes in px,
   to both sides when --sway-both is 1, else inward only) and adds .has-stem; without JS the seed bullets and hairlines stay */
.stem-list { --line: 0; --sway: 10; --sway-both: 0; --leaf-len: 20; position: relative; margin-top: clamp(16px, 2vw, 24px); } /* phone leaves short enough that no tip reaches the words or the screen's edge */
.stem-list:not(.has-stem) .statements { border-bottom: 1px solid var(--hair); }
.stem-list + .lead { max-width: 48ch; margin-top: clamp(32px, 4vw, 48px); color: var(--ink); }
.statement {
  --size: clamp(1.75rem, 3.2vw, 2.75rem); /* the home's stage-heading size */
  display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: clamp(20px, 3vw, 40px); align-items: start;
  padding-block: clamp(32px, 4vw, 48px); border-top: 1px solid var(--hair);
}
.statement .seed { width: 10px; height: 10px; margin-top: calc(var(--size) * .525 - 5px); border-radius: 50%; background: var(--leaf); }
.statement h3 { max-width: 24ch; font-size: var(--size); }
.statement p { max-width: 56ch; margin-top: 16px; text-wrap: pretty; }

/* the stem: a faint track and the grown stem over it, deepening down its length; a node (orange) on it level with each heading's first line */
.stem-track { stroke: var(--hair); stroke-width: 1; }
.stem-grown { stroke: url(#why-stem-grad); stroke-width: 2; stroke-linecap: round; }
.stem .stop-top { stop-color: var(--leaf); }
.stem .stop-end { stop-color: var(--leaf-deep); }
.stem .node { fill: var(--seed); stroke: var(--hair); stroke-width: 1; }
/* the walker is the logo's sprout; why.js moves it along the stem (x, y = its centre's point on the path); only under html.anim */
.sprout {
  position: absolute; left: 0; top: 0; z-index: 2; display: none; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  background: url(assets/logo-mark.svg) center / contain no-repeat; filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--seed-deep) 40%, transparent));
}
html.anim .sprout { display: block; }
/* phones and tablets: the stem down the left edge, the statements indented past its sway */
.has-stem .seed { display: none; }
.has-stem .statements { padding-block: clamp(32px, 4vw, 48px); }
.has-stem .statement { display: block; padding: 0 0 0 40px; border-top: 0; }
.has-stem .statement + .statement { margin-top: 48px; }
/* desktop: the stem down the middle; 1, 3, 5 in the left column (ending 6% short of the centre), 2 and 4 in the right (from 6% past it);
   each spans two rows, so every statement starts beside the one before it and below the one before that */
@media (min-width: 981px) {
  .stem-list { --line: .5; --sway: 24; --sway-both: 1; --leaf-len: 36; }
  /* the heading and intro centred over the stem, like the closing line under it: heading, stem, closing line down one middle */
  .problems-label, .stem-list + .lead { margin-inline: auto; text-align: center; }
  .has-stem .statements { display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 12fr) minmax(0, 44fr); row-gap: clamp(24px, 3vw, 40px); }
  .has-stem .statement { padding: 0; }
  .has-stem .statement + .statement { margin-top: 0; }
  .has-stem .statement:nth-child(odd) { grid-column: 1; }
  .has-stem .statement:nth-child(even) { grid-column: 3; }
  .has-stem .statement:nth-child(1) { grid-row: 1 / span 2; }
  .has-stem .statement:nth-child(2) { grid-row: 2 / span 2; }
  .has-stem .statement:nth-child(3) { grid-row: 3 / span 2; }
  .has-stem .statement:nth-child(4) { grid-row: 4 / span 2; }
  .has-stem .statement:nth-child(5) { grid-row: 5 / span 2; }
}

/* ---------- Comparison: hairline rows; under html.anim each row's marks draw as it scrolls into view ---------- */
.why-compare h2 { max-width: 18ch; }
.compare-intro { max-width: 60ch; }
.compare { margin-top: clamp(40px, 5vw, 64px); }
.compare-head, .compare-row {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr); gap: 12px 32px; align-items: center;
  border-bottom: 1px solid var(--hair);
}
.compare-head { padding-block: 0 16px; font: 700 .8125rem/1.4 var(--sans); color: var(--ink); }
.recommended { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-weight: 600; color: var(--leaf-deep); }
.recommended::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--seed); }
.compare-row { padding-block: 22px; }
.compare-row .compare-feature { font: 500 1.25rem/1.3 var(--display); font-variation-settings: 'SOFT' 100; color: var(--ink); }
.compare-row [role="cell"] { display: flex; align-items: center; gap: 12px; }
.compare-vendor { color: var(--muted); }
.compare-row .compare-himala { color: var(--ink); font-weight: 600; }

/* the marks: drawn by default; under html.anim a row that has not scrolled into view yet shows only the hairline (why.js adds .filled) */
.mark { flex: none; width: 22px; height: 22px; overflow: visible; }
.mark circle { stroke-width: 1; }
.mark path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
/* transitions only under html.anim: when the gate drops motion (CDN failed) the marks snap to drawn */
html.anim .mark circle { transition: fill .3s var(--ease), stroke .3s var(--ease); }
html.anim .mark path { transition: stroke-dashoffset .6s var(--ease) .1s; }
.mark.check circle { fill: var(--leaf); stroke: var(--leaf); }
.mark.check path { stroke: var(--bg); }
.mark.cross circle { fill: var(--hair); stroke: var(--hair); }
.mark.cross path { stroke: var(--muted); stroke-width: 1.6; }
html.anim .compare-row:not(.filled) .mark circle { fill: transparent; stroke: var(--hair); }
html.anim .compare-row:not(.filled) .mark path { stroke-dashoffset: 1; }

/* ---------- The hidden cost: the heading beside three smaller statement rows; on desktop the logo, grown, fills the blank under the heading ---------- */
.why-cost > .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; align-items: start; }
.cost-intro { max-width: 40ch; }
/* the plant (why.js draws it to the box's height: the bean at the root, two stem strokes, seven of the stem's leaves); only where there is a blank beside the costs */
.plant { display: none; }
@media (min-width: 981px) {
  .why-cost > .wrap { align-items: stretch; }
  .cost-head { display: flex; flex-direction: column; }
  .plant { display: block; position: relative; flex: 1; min-height: 240px; margin-top: 40px; }
}
.plant-stem { stroke: var(--leaf-deep); stroke-linecap: round; }
/* once grown, each leaf flutters faintly on its own; the inner group pivots at the leaf's base (why.js nests it inside the placed group) */
.plant .flutter { transform-box: view-box; transform-origin: 0 0; }
html.anim .plant .leaves.open .flutter { animation: flutter 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes flutter { 0%, 100% { rotate: 0deg; } 50% { rotate: var(--f, 4deg); } }
.plant .bean { fill: var(--seed); }
.plant .bean-hi { fill: color-mix(in srgb, var(--seed) 55%, white); }
.cost { padding-block: 28px; border-bottom: 1px solid var(--hair); }
.cost:first-child { padding-top: 0; }
.cost:last-child { padding-bottom: 0; border-bottom: 0; } /* the helps block's hairline closes the list */
.cost-title { font: 500 1.5rem/1.2 var(--display); font-variation-settings: 'SOFT' 100; letter-spacing: -.01em; color: var(--ink); }
.cost-title + p { max-width: 60ch; margin-top: 10px; text-wrap: pretty; }
.helps { margin-top: 48px; padding-block: 28px; border-block: 1px solid var(--hair); }
.helps h3 { font: 600 .8125rem/1.5 var(--sans); letter-spacing: 0; color: var(--muted); }
.helps h3 + p { margin-top: 14px; color: var(--ink); }
.helps p { max-width: 60ch; }
.note { margin-top: 24px; max-width: 60ch; font-size: .8125rem; color: var(--muted); }

/* ---------- Motion (html.anim only): a statement waits 24px low and its node unlit until the stem reaches it (why.js adds .in, .on); it moves, it never fades ---------- */
html.anim .statement[data-reveal] { transition: translate .6s var(--ease); }
html.anim .statement[data-reveal]:not(.in) { translate: 0 24px; }
html.anim .stem .node { transition: fill .3s var(--ease); }
html.anim .stem .node:not(.on) { fill: var(--bg); }

/* ---------- Tablets and phones ---------- */
@media (max-width: 980px) {
  .why-cost > .wrap { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 760px) {
  /* the header row stays for screen readers; each cell carries its column name as a small label */
  .compare-head { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .compare-row { grid-template-columns: 1fr; gap: 12px; padding-block: 24px; }
  .compare-head + .compare-row { border-top: 1px solid var(--hair); }
  .compare-row [role="cell"] { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; }
  .compare-row [role="cell"]::before { content: attr(data-label); content: attr(data-label) / ""; grid-column: 2; font: 600 .8125rem/1.4 var(--sans); color: var(--muted); }
  .compare-row [role="cell"] .mark { grid-row: 1 / span 2; align-self: center; }
  .compare-row [role="cell"] > span { grid-column: 2; }
}
