/* ---------- Home: three stacked panels ----------
   Near full-screen white cards. Each is position: sticky at the same top, so the next card
   rises over the one before it. scripts/stack-panels.js writes two numbers per panel:
     transform / opacity of the card, its text and its video frame, written straight onto the elements (no CSS variables,
     so nothing below the card is restyled while you scroll). The card falls back as the next one rises: it shrinks a
     little, tilts away at the top, lifts and fades into the page. No lines inside the cards. */

.stk {
  --stk-top: clamp(72px, 8.5vh, 96px);
  position: relative;
  z-index: 7;
  margin-top: -14vh;   /* the first card starts rising while the morph above is still finishing */
  padding: 6vh 0 0;
}

.stk-panel {
  position: sticky;
  top: var(--stk-top);
  width: calc((100% - clamp(28px, 6.25vw, 120px)) * 0.935);   /* all sizes on these cards are 5% down */
  max-width: 1840px;
  height: max(508px, calc((100vh - var(--stk-top) - 4vh - 5px) * 0.95));
  margin: 0 auto 4vh; /* no pause: the next card starts rising as soon as this one is in place */
  contain: layout style;
}
.stk-panel:last-child { margin-bottom: 10vh; }

.stk-card {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: clamp(22px, 2.2vw, 36px);
  overflow: hidden;
  color: var(--ink, #141311);
  /* a plain white card: a hairline ring and a soft, long shadow lift it off the page */
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(20, 19, 17, 0.05),
    0 2px 6px rgba(20, 19, 17, 0.05),
    0 40px 80px -42px rgba(20, 19, 17, 0.28);
  transform-origin: 50% 100%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
/* a card that has fallen back is also a little darker (its opacity is written by the script) */
.stk-shade { position: absolute; inset: 0; border-radius: inherit; background: #141311; opacity: 0; pointer-events: none; }

.stk-text, .stk-media { position: relative; }

/* ---- text column (the reference layout: tiny caption top-left, big title bottom-left) ---- */
.stk-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: calc(clamp(36px, 9vh, 92px) * 0.95) calc(clamp(22px, 3vw, 56px) * 0.95) calc(clamp(30px, 7.5vh, 72px) * 0.95) calc(clamp(26px, 4.2vw, 84px) * 0.95);
}
.stk-cap {
  max-width: 15em;
  margin: 0;
  font-size: calc(clamp(0.95rem, 1.1vw, 1.3rem) * 0.95);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: rgba(20, 19, 17, 0.62);   /* 5.2:1 on white (was 0.5, 3.5:1, which failed) */
}
.stk h2 {
  margin: 0;
  font-size: calc(clamp(2.4rem, 3.75vw, 4.6rem) * 0.95);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.058em;
  color: var(--ink, #141311);
}
/* the serif italic accent, as in the hero and on the Services steps */
.stk h2 .accent-serif { font-weight: 400; letter-spacing: -0.03em; }
.stk-pill { align-self: flex-start; }
.stk-lead { margin: clamp(14px, 2.2vh, 24px) 0 0; font-size: calc(clamp(1.05rem, 1.35vw, 1.5rem) * 0.95); font-weight: 500; line-height: 1.3; letter-spacing: -0.024em; color: var(--ink, #141311); }
.stk-lead + .stk-p { margin-top: 0.55em; }
/* three short proof lines, the same small white-tile icons as the Services steps */
.stk-points { list-style: none; margin: clamp(16px, 2.6vh, 28px) 0 0; padding: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.3vh, 14px); }
.stk-points li { display: flex; align-items: center; gap: 0.85em; font-size: calc(clamp(0.9rem, 1.05vw, 1.15rem) * 0.95); font-weight: 500; letter-spacing: -0.012em; color: var(--ink, #141311); }
.stk-points svg { flex: none; box-sizing: border-box; width: 2.35em; height: 2.35em; padding: 0.62em; border-radius: 0.75em; background: #F4F4F5; box-shadow: inset 0 0 0 1px rgba(20, 19, 17, 0.05); color: rgba(20, 19, 17, 0.72); }
.stk-p {
  max-width: 29em;
  margin: clamp(14px, 2.2vh, 24px) 0 0;
  font-size: calc(clamp(1rem, 1.25vw, 1.4rem) * 0.95);
  line-height: 1.45;
  letter-spacing: -0.022em;
  color: rgba(20, 19, 17, 0.68);   /* 6.4:1 on white (was 0.58, 4.5:1, right on the limit) */
}
.stk-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-top: clamp(16px, 2.6vh, 28px);
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(20, 19, 17, 0.3);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink, #141311);
  text-decoration: none;
  transition: gap 0.25s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.2s ease, transform 0.16s ease-out;
}
.stk-link svg { width: 14px; height: 14px; }
.stk-link:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .stk-link:hover { gap: 13px; border-color: var(--ink, #141311); }
}

/* ---- video frame: a plain white placeholder. Put a <video> inside it (width/height 100%, object-fit: cover) later ---- */
.stk-media {
  position: relative;
  display: grid;
  place-items: center;
  --in: calc(clamp(14px, 2.3vw, 44px) * 0.95); /* the frame is 5% smaller than before: wider gap on its left, same gap above, below and on the right */
  margin: var(--in);
  margin-left: calc(var(--in) * 1.8);
  min-width: 0;
  border-radius: clamp(16px, 1.4vw, 28px);
  overflow: hidden;
  background: #F4F4F5;   /* the video frame is a soft grey well inside the white card */
  box-shadow: inset 0 0 0 1px rgba(20, 19, 17, 0.05);
}
.stk-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stk-play {
  width: clamp(46px, 4.4vw, 74px);
  height: clamp(46px, 4.4vw, 74px);
  color: rgba(20, 19, 17, 0.14);
}

/* ---- phones, tablets and reduced motion: plain stacked cards, no pinning, no depth effect ---- */
@media (max-width: 900px) {
  .stk { padding-top: 3vh; margin-top: 0; }
  .stk-panel { position: relative; top: auto; height: auto; min-height: 0; width: calc(100% - 24px); margin-bottom: 14px; }
  .stk-panel:last-child { margin-bottom: 40px; }
  .stk-card {
    grid-template-columns: 1fr;
    background: #fff;
    transform: none;
    opacity: 1;
    will-change: auto;
  }
  .stk-shade { display: none; }
  .stk-text { gap: 44px; padding: 24px 22px 8px; }
  .stk-media { aspect-ratio: 16 / 10; margin: 14px; }
  .stk h2 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .stk-p { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .stk-panel { position: relative; top: auto; height: auto; min-height: 0; margin-bottom: 14px; }
  .stk-panel:last-child { margin-bottom: 40px; }
  .stk-card { transform: none; opacity: 1; will-change: auto; }
  .stk-shade { display: none; }
  .stk-text { gap: 60px; }
  .stk-link { transition: none; }
}
