/* Card flip row · Scroll Story Kit
   Static (no JS, reduced motion): the fronts only, in a row of four (two on tablets, one on phones).
   Motion: every card starts face down showing a big number and turns over in 3D, one after another, as the row
   comes up to the middle of the screen. --sk-flip-a (start) and --sk-flip-w (length) on each card are shares of
   the row's cover progress; they are set per layout, so a phone column flips each card as it reaches the middle. */
.sk-flip-head { max-width: 760px; }
.sk-flip-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sk-gap); margin: clamp(32px, 5vw, 56px) 0 0; padding: 0; list-style: none; }
.sk-flip-card { --i: 0; position: relative; }
.sk-flip-card:nth-child(2) { --i: 1; }
.sk-flip-card:nth-child(3) { --i: 2; }
.sk-flip-card:nth-child(4) { --i: 3; }
.sk-flip-inner { position: relative; height: 100%; }
.sk-flip-front {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; height: 100%; min-height: 300px;
  padding: clamp(22px, 2.4vw, 30px); border-radius: var(--sk-radius); background: var(--sk-surface); box-shadow: 0 0 0 1px var(--sk-line), var(--sk-shadow-sm);
}
.sk-flip-icon { flex: none; width: 56px; height: 56px; margin-bottom: auto; padding: 12px; border-radius: 50%; background: var(--sk-sunk); color: var(--sk-accent-text); }
.sk-flip-front .sk-h3 { margin-top: 28px; }
.sk-flip-front .sk-text { margin: 0; font-size: var(--sk-size-small); line-height: 1.55; }
/* the backs only show with motion: tucked away (never display:none, so their boxes stay put) */
:root:not(.sk-on) .sk-flip-back { position: absolute; width: 1px; height: 1px; overflow: clip; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 980px) { .sk-flip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .sk-flip-row { grid-template-columns: 1fr; gap: 14px; }
  .sk-flip-front { min-height: 240px; }
}

/* motion */
:root.sk-on .sk-flip-card { --sk-flip-a: calc(.2 + var(--i) * .07); --sk-flip-w: .14; perspective: 1400px; }
:root.sk-on .sk-flip-inner {
  --f: clamp(0, (var(--sk-p) - var(--sk-flip-a)) / var(--sk-flip-w), 1);
  --g: calc(var(--f) * var(--f) * (3 - 2 * var(--f)));
  transform-style: preserve-3d;
  transform: translateZ(calc(sin(var(--g) * 180deg) * 60px)) rotateY(calc((1 - var(--g)) * -180deg));
  will-change: transform;
}
:root.sk-on .sk-flip-front, :root.sk-on .sk-flip-back { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
:root.sk-on .sk-flip-back {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(22px, 2.4vw, 30px);
  border-radius: var(--sk-radius); transform: rotateY(180deg); box-shadow: var(--sk-shadow-sm);
  background: radial-gradient(circle at 100% 0, var(--sk-flip-ring) 0 34%, transparent 34.5%), var(--sk-flip-bg);
  color: var(--sk-on-accent);
  --sk-flip-bg: var(--sk-accent); --sk-flip-ring: var(--sk-accent-3);
}
:root.sk-on .sk-flip-card:nth-child(2) .sk-flip-back { --sk-flip-bg: var(--sk-accent-2); --sk-flip-ring: var(--sk-accent-3); }
:root.sk-on .sk-flip-card:nth-child(3) .sk-flip-back { --sk-flip-bg: var(--sk-accent-4); --sk-flip-ring: var(--sk-accent); }
:root.sk-on .sk-flip-card:nth-child(4) .sk-flip-back { --sk-flip-bg: var(--sk-ink); --sk-flip-ring: var(--sk-accent-2); color: var(--sk-paper); }
:root.sk-on .sk-flip-hint { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
:root.sk-on .sk-flip-num { font-family: var(--sk-font-display); font-size: clamp(5rem, 3rem + 5vw, 8rem); font-weight: var(--sk-weight-display); letter-spacing: -0.05em; line-height: .8; }

@media (max-width: 980px) {
  :root.sk-on .sk-flip-card { --sk-flip-a: calc(.16 + var(--i) * .09); --sk-flip-w: .14; }
}
@media (max-width: 600px) {
  :root.sk-on .sk-flip-card { --sk-flip-a: calc(.1 + var(--i) * .15); --sk-flip-w: .13; }
}
