/* Starwink website v9 (2026-09-29): the keepsakes scene, second pass (founder: the title on two lines; the large blurred
   treasures scroll into view first and start further up; large and small treasures in a dynamic composition, above,
   below and behind the card; vertical parallax only; a striking, immersive section). v4.js places and moves every
   plane; CSS sets the planes and their stacking. Phones keep their grid. */

/* the title on two lines (the break is in the copy) */
.k4-head .h2 { white-space: pre-line; text-wrap: balance; }

@media (min-width: 820px) {
  .k4-head { position: relative; z-index: 31; }   /* the words stay above every plane */
  /* near: the whole section is its space, so the first ones rise beside the title */
  .k8-near { position: absolute; inset: 0; z-index: 30; pointer-events: none; -webkit-mask-image: none; mask-image: none; }
  .k8-n { left: var(--x); top: 0; }
  /* mid: in front of the card or tucked behind it */
  .k4-t[data-plane="front"] { z-index: 12; }
  .k4-t[data-plane="back"] { z-index: 5; }
  .k4-t[data-plane="back"] img { filter: drop-shadow(0 8px 12px rgba(var(--shadow-rgb), 0.5)) saturate(0.95); }
  .k4-card { transition: opacity calc(200ms * var(--dz-k)) var(--ease-light), transform calc(200ms * var(--dz-k)) var(--ease-light); }
}
@media (prefers-reduced-motion: reduce) {
  .k8-near { display: none; }
}

/* the hint has its own ground, so treasures drifting past (arm B) go behind it, never over the words */
.k8-hint { z-index: 13; padding: 6px var(--sp-3); border-radius: var(--radius-pill); background: var(--l0); box-shadow: inset 0 0 0 1px var(--hairline); }

/* phones: the light version (no hold, two bands round the card, two blurred ones at the edges, no far plane, no idle float) */
@media (max-width: 819.98px) {
  .k4-head { position: relative; z-index: 31; }
  .k4-field { position: relative; padding: var(--k9-top, 0px) 0 var(--k9-bot, 0px); }
  .k4-float { position: absolute; inset: 0; display: block; padding: 0; }
  .k4-t { position: absolute; left: var(--x); top: var(--y); width: var(--s); max-width: none; justify-self: auto; will-change: transform; }
  .k4-t[data-pplane="front"] { z-index: 12; }
  .k4-t[data-pplane="back"] { z-index: 5; }
  .k4-t img, .k4-halo { animation: none; }
  .k4-card { position: relative; z-index: 10; width: auto; max-width: min(27rem, calc(100% - 2 * var(--site-gutter))); margin: 0 auto; }
  .k8-hint { position: relative; display: block; width: fit-content; margin: var(--sp-4) auto 0; }
  .k8-near { display: block; position: absolute; inset: 0; z-index: 30; pointer-events: none; -webkit-mask-image: none; mask-image: none; }
  .k8-n { position: absolute; left: var(--x); top: 0; width: var(--s); height: var(--s); object-fit: contain; opacity: 0.94; will-change: transform; }
  .k8-n.is-off { display: none; }
}

/* phones: the two-line title must fit its longest line (Romanian "se termină cu o amintire") inside a 360px screen */
@media (max-width: 819.98px) {
  .k4-head .h2 { font-size: clamp(1.6rem, 6.9vw, 2.6rem); }
}
