/* ─────────────────────────────────────────────────────────────────────────
   Section: Solutions Feature Cards — Figma 2225:312 / 2225:315 / 2225:325
   (desktop, 1440 canvas) and 2353:3820 (mobile, 360 canvas).

   SCROLL-DRIVEN HORIZONTAL TRACK (>= 48rem), ref wildbran.pt/manufacturing.
   Three nested boxes, each with one job — the same architecture the
   homepage One Platform deck uses:

     __stack     the scroll runway. Its EXTRA height over one viewport is
                 exactly the horizontal distance the track has to travel,
                 so one pixel of scrolling moves the track one pixel. It
                 also carries the view-timeline the animation reads.
     __pin       the single sticky element. Because one element is pinned
                 (rather than each card being sticky in its own right) the
                 four cards can never drift apart or unpin at different
                 moments — they enter and leave as one piece.
     __viewport  the clipping window.
     __track     the row that actually translates.

   Pure CSS. No scroll listener, no library, so the motion follows the
   scrollbar exactly and can never desync from it.

   WHY `contain` AND NOT `entry`/`cover`: with a sticky child, the pin is
   held from the moment the stack's top reaches the viewport top until its
   bottom reaches the viewport bottom. That interval is precisely the
   `contain` range. `entry` spans only the element's own height and would
   run the whole animation before the section had finished arriving.

   THE TRAVEL EXPRESSION: `translateX(calc(100vw - 100%))`. Because the
   track is width:max-content its 100% ALREADY INCLUDES its own left and
   right padding, so subtracting it from the viewport lands the track's
   right padding edge exactly on the viewport's right edge — gutters
   accounted for, nothing to add. An earlier version used
   `calc(<visible> - 100%)` where <visible> had the gutters subtracted out,
   which counted them twice and stopped the last card 286px short of its
   mark. The min(0px, …) guard matters on very wide screens: once the
   viewport is wider than the track the result goes positive and would
   shunt the cards RIGHT, off their own left edge.

   GUTTERS. Figma declares the section padding as 151px 0 160px 174px. The
   left 174 is used as-is. The right 0 is NOT: it reads as zero only
   because the static frame's two visible cards never reach the edge, so
   nothing is ever flush against it. Applied literally to a scroller it
   parks the last card hard against the viewport edge. The track therefore
   closes on the same 174 it opens with, so the deck ends with the margin
   it started with.

   THE CARDS ARE NOT ONE REPEATED COMPONENT. Figma hand-places each one, so
   all four differ and the differences are deliberate:
     • aspect  540x623 desktop vs 304x483 mobile — a different shape, not a
               scaled one, so aspect-ratio is set per breakpoint
     • padding each card has its own asymmetric pt/pb. That asymmetry is
               what positions the copy: card 1 is pt 103 / pb 160, which
               centres its 350-tall text block at y=108, exactly where
               Figma puts it. Equalising the padding moves every card's
               copy off its mark.
     • text    each block has its own width (401 / 444 / 474 / 441) and
               card 4 is 37px where the others are 38
     • colour  card 3's copy is ivory #F6F8ED, the rest white
     • angle   the gradient angles differ between desktop and mobile
               because the card aspect differs

   CARD 4's GRADIENT IS CARD 2's, MIRRORED. Figma wraps it in
   rotate(180deg) scaleY(-1), which composes to a plain horizontal flip, so
   the angle becomes 360 − 215.814 = 144.186deg. Expressed as an angle
   rather than a transform on purpose — a transform would mirror the copy
   too. On MOBILE Figma does not mirror it at all, so there card 4 simply
   repeats card 2's angle.
   ───────────────────────────────────────────────────────────────────── */

.section-solutions-cards {
  background: var(--color-navy-dark, #001428);
  color: var(--color-white, #fff);

  /* Card geometry drives everything else. One source of truth: change the
     card width and the gap, travel and runway all follow. */
  --space-sol-card-w: 84.444vw; /* 304 of 360 */
  --space-sol-card-gap: 5vw; /* 18 */
  --space-sol-card-pad: 5.5556vw; /* 20 */
}

/* ── Mobile: native scroll-snap carousel ──────────────────────────────── */

.section-solutions-cards__stack {
  padding-block: 16.667vw; /* 60 */
}

/* The clipping window is also a CONTAINER, so the keyframe can measure the
   real content width with cqw. 100vw includes the scrollbar gutter; the
   track's own width does not. Ending the travel at `100vw - 100%` therefore
   stopped the deck a scrollbar-width short of its mark, so the last card
   never quite reached the gutter. cqw is the container's content box —
   scrollbar excluded — so the last card lands exactly where it should. */
.section-solutions-cards__viewport {
  container-type: inline-size;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-solutions-cards__viewport::-webkit-scrollbar {
  display: none;
}

.section-solutions-cards__track {
  display: flex;
  align-items: stretch;
  gap: var(--space-sol-card-gap);
  width: max-content;
  padding-inline: var(--space-sol-card-pad);
  margin: 0;
  list-style: none;
}

.section-solutions-cards__card {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--space-sol-card-w);
  /* min-height, not aspect-ratio: the track stretches every card to the
     tallest, and a hard ratio would clip copy that wraps to more lines than
     Figma's on a narrow phone. This keeps Figma's height as the floor. */
  min-height: calc(var(--space-sol-card-w) * 1.588816);
  padding-inline: calc(var(--space-sol-card-w) * 0.105263); /* 32 of 304 */
  padding-block: calc(var(--space-sol-card-w) * 0.184211); /* 56 of 304 */
  overflow: hidden;
  border: 1px solid var(--color-navy, #001f3e);
  border-radius: var(--radius-card);
  scroll-snap-align: center;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
}

/* TYPE IS SIZED FROM THE CARD, NOT THE VIEWPORT. The card is capped by
   height as well as width (see the desktop block), so on a short viewport
   it is narrower than its vw would suggest. A vw-based font then keeps its
   full size inside a shrunken card, blowing the text-to-card ratio and
   wrapping the copy onto more lines than the design has. Deriving every
   internal dimension from --space-sol-card-w holds Figma's proportions
   exactly, at any viewport.

   NO letter-spacing: Figma's card text nodes carry none. The old markup
   applied tracking-headline (-0.024em) here, which was never in the design. */
.section-solutions-cards__text {
  width: 100%;
  font-family: var(--font-primary, "Inter", sans-serif);
  font-weight: 500;
  font-size: calc(var(--space-sol-card-w) * 0.078947); /* 24 of 304 */
  line-height: calc(var(--space-sol-card-w) * 0.102632); /* 31.2 of 304 */
  color: var(--color-white, #fff);
}

.section-solutions-cards__text--cream {
  color: var(--color-cream, #f6f8ed);
}

/* Per-card gradients — mobile angles. */
.section-solutions-cards__card--green-yellow {
  background-image: linear-gradient(
    124.528deg,
    rgb(0 128 77 / 60%) 4.1034%,
    rgb(219 230 76 / 60%) 66.661%,
    rgb(255 255 255 / 60%) 87.361%
  );
}

.section-solutions-cards__card--royal-green,
.section-solutions-cards__card--royal-green-flip {
  background-image: linear-gradient(224.82deg, rgb(24 58 115) 4.802%, rgb(56 94 48) 98.513%);
}

.section-solutions-cards__card--viridian {
  background-image: linear-gradient(
    194.324deg,
    rgb(0 128 77 / 90%) 46.941%,
    rgb(219 230 76 / 90%) 100.22%,
    rgb(255 255 255 / 90%) 141.06%
  );
}

/* Decorative glass shape inside the "Boards" card, clipped by the card's
   own radius. */
.section-solutions-cards__mask {
  position: absolute;
  display: block;
  left: 49.671%; /* 151 of 304 */
  top: 71.876%; /* 347.16 of 483 */
  width: 89.145%; /* 271 of 304 */
  aspect-ratio: 271 / 269;
  max-width: none;
  height: auto;
  pointer-events: none;
}

/* Visibility lives here, not on Tailwind utilities: this stylesheet loads
   after main.css and `.section-solutions-cards__mask` matches `.hidden` on
   specificity, so a `display` here would silently win and BOTH shapes would
   render. Mobile's aspect-ratio 271/269 matches its viewBox exactly, so it
   needs no correction of the kind the desktop export does. */
.section-solutions-cards__mask--desktop {
  display: none;
}

/* ── Dots ─────────────────────────────────────────────────────────────── */

.section-solutions-cards__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.7778vw; /* 10 */
  margin: 6.6667vw 0 0; /* 24 */
  padding: 0 5.5556vw 0 0; /* Figma offsets the row by 20 on the right */
  list-style: none;
}

.section-solutions-cards__dot {
  display: block;
  width: 3.6111vw; /* 13 */
  height: 3.6111vw;
  padding: 0;
  border: none;
  border-radius: 3.6111vw;
  background: #d9d9d9;
  cursor: pointer;
  transition:
    width 0.25s,
    background-color 0.25s;
}

.section-solutions-cards__dot[aria-current="true"] {
  width: 11.111vw; /* 40 */
  background: var(--color-yellow, #dbe64c);
}

/* ── CTA ──────────────────────────────────────────────────────────────── */

.section-solutions-cards__cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(22.5rem, 90vw);
  margin: 11.111vw auto 0; /* 40 */
  padding: 0.4375rem;
  border-radius: var(--radius-button);
  transition: opacity 0.2s;
}

.section-solutions-cards__cta:hover {
  opacity: 0.9;
}

.section-solutions-cards__cta-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-block: 0.9375rem;
  border-radius: var(--radius-button);
  background: var(--color-yellow, #dbe64c);
  font-family: var(--font-primary, "Inter", sans-serif);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.9375rem;
  letter-spacing: -0.016em;
  color: var(--color-navy, #001f3e);
}

/* ── Tablet and up: the pinned horizontal track ───────────────────────── */

@media (width >= 48rem) {
  .section-solutions-cards {
    /* 174 measured from the CENTRED 1440 canvas, not the viewport edge.
       Past 1440 the extra gutter carries the whole track inward so it lines
       up with the centred sections above and below it; at and under 1440
       the term is 0 and this is just 174. 100vw rather than 50% because
       this value also feeds --space-sol-travel, which sizes a HEIGHT — a
       percentage there would resolve against the wrong axis. */
    --space-sol-card-pad: calc(
      var(--space-sol-card-w) * 0.322222
    ); /* 174 — both gutters, from the viewport */
    --space-sol-card-gap: calc(var(--space-sol-card-w) * 0.137037); /* 74 */
    --space-sol-cta-h: calc(var(--space-sol-card-w) * 0.138889); /* 75 */

    /* THE CARD IS SIZED BY WIDTH, NOT BY HEIGHT.
       Figma 2225:312 is a 1440x1118 frame: gutter 174, card 540, gap 74,
       card 540 — summing to 1328, which is 92.2% of the frame. Because every
       term here is the same ratio of --space-sol-card-w, that 92.2% holds at
       EVERY width, so the deck opens on exactly TWO cards at 768, 1024, 1280
       and 1440 alike. Width was never the problem.

       WHAT WAS: a third term, calc(100svh / 2.070371), which scaled the whole
       vertical block (151 + 623 + 109 + 75 + 160 = 1118 = card-w * 2.070371)
       to fit the window HEIGHT — the one dimension Figma cannot specify. No
       laptop is 1118 tall, so it always won: at an 820-tall viewport the card
       resolved to ~396 and the gutter and gap shrank with it, fitting FOUR
       cards across the screen. The width caps never got a chance to apply.

       The height term that remains covers what the PIN must hold — the card
       (1.153704), the row gap (0.201852) and the CTA (0.138889), totalling
       1.494445 — PLUS 0.111111 of breathing room above and below (60px at
       Figma's 540), giving 1.716667. Figma's 151/160 section padding is not
       in it: that sits outside the sticky element (see the section rule
       below) and so never competes with the cards for viewport height.

       WHY THE BREATHING ROOM IS NOT OPTIONAL. Without it the pin's contents
       exactly equal the viewport, so justify-content:center has nothing to
       centre: the cards touch the top edge and the CTA the bottom edge, and
       the deck reads as jammed against the top of the screen rather than
       held in the middle of it. The 151/160 cannot serve this purpose — it
       is space BETWEEN sections and is only on screen before and after the
       pin, never during it.

       The two cannot both be maximised: at 1440x820 a 540 card already needs
       807 of the 820 available, leaving 13px. So the card gives ~10% on short
       windows and the composition stays centred. At 1440x900 it is 524, and
       on any window 980 or taller it is Figma's full 540 with 60+ px to
       spare. At 1209x700 the card is bound by 37.5vw at 453 and the whole
       composition is Figma's, scaled: 127 / 91 / 134.

       Above 1440 the card holds at 540 rather than growing — 38px copy should
       not become 50px on a 27" display — and the track simply reveals more of
       card 3 as the window widens, which is what a horizontal deck should do.
       The alternative, freezing two cards, would leave a dead right gutter. */
    --space-sol-card-w: min(33.75rem, 37.5vw, calc(100svh / 1.716667)); /* 540 */
    --space-sol-card-h: calc(var(--space-sol-card-w) * 1.153704); /* 623 of 540 */

    /* IT IS THE GUTTERS THAT GIVE, NOT THE CARD.
       Figma's block is 151 + 623 + 109 + 75 + 160 = 1118 tall, so on any
       window shorter than that something has to give. Each gutter takes the
       SMALLER of its Figma ratio and its share of the height actually left
       once the card and the CTA have taken theirs — split in Figma's own
       151:109:160 ratio (of 420) so the composition stays balanced.

       At 1440x1118 the room is exactly 420 and all three land on their exact
       Figma pixel: 151 / 109 / 160. At 1440x820 the card is height-bound at
       488, so the room is its floor of 190 and they read 68 / 49 / 72 — half
       the Figma ratio, the composition intact. Above 1118 tall the Figma
       ratio binds and the gutters stop growing; the pin then centres the
       block in the taller window. */
    --space-sol-pad-t: calc(var(--space-sol-card-w) * 0.27963); /* 151 */
    --space-sol-row-gap: calc(var(--space-sol-card-w) * 0.201852); /* 109 — card row to CTA */
    --space-sol-pad-b: calc(var(--space-sol-card-w) * 0.296296); /* 160 */

    /* What the PIN has to fit — the card, the gap and the CTA. The 151/160
       are deliberately NOT in here; see the note on the section padding. */
    --space-sol-block-h: calc(
      var(--space-sol-card-h) + var(--space-sol-row-gap) + var(--space-sol-cta-h)
    );
    /* Track width INCLUDING both gutters, and the distance it must travel to
       bring the last card flush right. max(0px, …) keeps the runway from
       going negative once the viewport is wide enough to show everything at
       once. --space-sol-track-w MUST stay declared: --space-sol-travel is
       built from it, and the stack's height is 100svh + travel. If it goes
       missing, travel resolves to nothing, the stack collapses to a single
       viewport, and the slide finishes in the first few pixels of scroll
       instead of running the length of the pin. */
    --space-sol-track-w: calc(
      2 * var(--space-sol-card-pad) + 4 * var(--space-sol-card-w) + 3 * var(--space-sol-card-gap)
    );
    --space-sol-travel: max(0px, calc(var(--space-sol-track-w) - 100vw));

    /* Figma's 151px 0 160px 174px. The vertical pair lives HERE, on the
       section, outside the sticky pin — and that placement is the whole
       point. 151 and 160 are empty space BETWEEN this section and its
       neighbours; nothing is drawn in them. Inside the pin they were
       competing with the cards for viewport height and losing: the block
       Figma draws is 151 + 623 + 109 + 75 + 160 = 1118 tall, so on an
       800-tall window the padding was being squeezed to ~66/70 and the card
       with it. Out here the padding is always exactly Figma's, and the pin
       only has to hold what is actually visible at once — 623 + 109 + 75. */
    padding-block: var(--space-sol-pad-t) var(--space-sol-pad-b);
  }

  /* DESKTOP FALLBACK. Without scroll-driven animation (Firefox today) or under
     prefers-reduced-motion this stays the horizontally scrollable carousel the
     mobile layout uses, at desktop card sizes. Everything that pins or clips
     now lives inside the guards further down.

     It used to clip here UNCONDITIONALLY while only the track's movement was
     guarded, so those browsers got overflow:hidden around a track that never
     moved — 1 of the 4 cards unreachable, and the dots that would have
     navigated to it hidden too. The section's own padding-block supplies the
     vertical rhythm, so nothing is needed here. */

  .section-solutions-cards__track {
    /* NO centred-canvas term on a SCROLLING track — that belongs only to
       static compositions. Added here it lands on BOTH gutters, so the
       track's own width grows by roughly the viewport width on a very wide
       screen; --travel is derived from that width, so the runway inflates
       and the page gains a screen-height of empty space before the cards,
       even at widths where all of them already fit without scrolling.
       The gutter stays the plain page gutter, and the track centres itself
       via margin-inline:auto once it is narrower than the viewport — at
       which point --travel is 0, the runway collapses to one viewport, and
       the keyframe's min(0px, …) holds the translation at zero. */
    gap: var(--space-sol-card-gap);
    padding-inline: var(--space-sol-card-pad);
    margin-inline: auto;
  }

  .section-solutions-cards__card {
    position: relative;
    width: var(--space-sol-card-w);
    aspect-ratio: 540 / 623;
    padding: calc(var(--space-sol-card-w) * 0.190741) calc(var(--space-sol-card-w) * 0.077778)
      calc(var(--space-sol-card-w) * 0.416667) calc(var(--space-sol-card-w) * 0.1); /* 103 42 225 54 */
    /* Clear the mobile floor — it is derived from the 304-wide card and at
       desktop resolves taller than this ratio, which would win and stretch
       every card. */
    min-height: 0;
    scroll-snap-align: none;
  }

  .section-solutions-cards__text {
    position: absolute;
    margin: 0;
    font-size: calc(var(--space-sol-card-w) * 0.07037); /* 38 of 540 */
    line-height: calc(var(--space-sol-card-w) * 0.092593); /* 50 of 540 */
  }

  /* EVERY card carries the same Figma padding — 103 42 225 54 — and the same
     540x623 box. The four text blocks are NOT positioned by that padding:
     in Figma each is an ABSOLUTELY POSITIONED child with its own x/y/width
     (69.5/108/401, 54/125.5/444, 47/115/474, 61/115/441), which is why they
     differ despite identical padding. An absolute child ignores the parent's
     padding entirely, so reproducing those offsets AS padding — which is what
     this file used to do — was fighting the same numbers from the wrong end.

     Offsets are calc(card-w * ratio), never percentages: a percentage would
     resolve against the card's padding box (538/621 after the 1px border),
     not the 540 the ratios come from. */

  .section-solutions-cards__card--green-yellow {
    background-image: linear-gradient(
      133.455deg,
      rgb(0 128 77 / 60%) 4.1034%,
      rgb(219 230 76 / 60%) 66.661%,
      rgb(255 255 255 / 60%) 87.361%
    );
  }

  .section-solutions-cards__card--green-yellow .section-solutions-cards__text {
    left: calc(var(--space-sol-card-w) * 0.128704);
    top: calc(var(--space-sol-card-w) * 0.2);
    width: calc(var(--space-sol-card-w) * 0.742593);
  }

  .section-solutions-cards__card--royal-green {
    background-image: linear-gradient(215.814deg, rgb(24 58 115) 4.802%, rgb(56 94 48) 98.513%);
  }

  .section-solutions-cards__card--royal-green .section-solutions-cards__text {
    left: calc(var(--space-sol-card-w) * 0.1);
    top: calc(var(--space-sol-card-w) * 0.232407);
    width: calc(var(--space-sol-card-w) * 0.822222);
  }

  .section-solutions-cards__card--viridian {
    background-image: linear-gradient(
      190.504deg,
      rgb(0 128 77 / 90%) 46.941%,
      rgb(219 230 76 / 90%) 100.22%,
      rgb(255 255 255 / 90%) 141.06%
    );
  }

  .section-solutions-cards__card--viridian .section-solutions-cards__text {
    left: calc(var(--space-sol-card-w) * 0.087037);
    top: calc(var(--space-sol-card-w) * 0.212963);
    width: calc(var(--space-sol-card-w) * 0.877778);
  }

  .section-solutions-cards__card--royal-green-flip {
    background-image: linear-gradient(144.186deg, rgb(24 58 115) 4.802%, rgb(56 94 48) 98.513%);
  }

  .section-solutions-cards__card--royal-green-flip .section-solutions-cards__text {
    left: calc(var(--space-sol-card-w) * 0.112963);
    top: calc(var(--space-sol-card-w) * 0.212963);
    width: calc(var(--space-sol-card-w) * 0.816667);
    font-size: calc(var(--space-sol-card-w) * 0.068519); /* 37 of 540 — the odd one out */
  }

  /* The export's viewBox is 383x339 while the artwork inside it is the
     379x331 panel — the extra 4x8 is the stroke's bleed. The file is
     preserveAspectRatio="none", so pinning aspect-ratio to the ARTWORK
     (379/331 = 1.145) instead of the VIEWBOX (383/339 = 1.130) squashed the
     panel horizontally and pulled the masked ellipse off its arc.
     Sizing the box to 383 viewBox units renders the 379 artwork at exactly
     379, undistorted. Offsets are calc(card-w * ratio), not percentages:
     percentages here resolve against the card's padding box (538/621 after
     the 1px border), landing the shape a pixel off Figma's 156/292. */
  .section-solutions-cards__mask--mobile {
    display: none;
  }

  .section-solutions-cards__mask--desktop {
    display: block;
  }

  .section-solutions-cards__mask {
    left: calc(var(--space-sol-card-w) * 0.288889); /* 156 of 540 */
    top: calc(var(--space-sol-card-w) * 0.540741); /* 292 (of the 623 height) */
    width: calc(var(--space-sol-card-w) * 0.709259); /* 383 viewBox units */
    aspect-ratio: 383 / 339;
  }

  .section-solutions-cards__cta {
    width: min(22.5rem, 25vw); /* 360 */
    height: var(--space-sol-cta-h); /* 75 */
    margin: 0 auto;
  }

  .section-solutions-cards__cta-inner {
    padding-block: 0;
    font-size: min(1.25rem, 1.3889vw); /* 20 */
  }

  /* Browsers without scroll-driven animation (Safari at time of writing)
     and readers who asked for less motion keep the plain scrollable track —
     these guards only ADD the pinning, never hide anything. */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .section-solutions-cards__stack {
        /* One viewport to hold the pin, plus exactly the horizontal travel —
           giving a 1:1 scroll-to-slide ratio. */
        height: calc(max(100svh, var(--space-sol-block-h)) + var(--space-sol-travel));
        padding-block: 0;
        view-timeline-name: --sol-cards;
        view-timeline-axis: block;
      }

      /* Figma padding 151px 0 160px 174px — the horizontal gutters live on the
         track (they have to scroll with the cards), the vertical pair on the
         section, outside this element. The pin carries no padding of its own:
         it holds exactly the card row, the 109 gap and the CTA. */
      .section-solutions-cards__pin {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: var(--space-sol-row-gap);
        height: max(100svh, var(--space-sol-block-h));
        overflow: hidden;
      }

      .section-solutions-cards__viewport {
        overflow: hidden;
        scroll-snap-type: none;
      }

      .section-solutions-cards__dots {
        display: none;
      }

      .section-solutions-cards__track {
        animation: section-solutions-cards-slide linear both;
        animation-timeline: --sol-cards;
        animation-range: contain 0% contain 100%;
      }
    }
  }
}

@keyframes section-solutions-cards-slide {
  from {
    transform: translateX(0);
  }

  to {
    /* 100% is the track's own width INCLUDING its gutters, so this lands
       its right padding edge on the viewport edge. See the travel note. */
    transform: translateX(min(0px, calc(100cqw - 100%)));
  }
}
