/* Phones: a section with a story plan is one full screen (kphone-story.js).
   Each sec-*.css only composes its own scene for the tall screen. Loaded last. */

html.kp-narrow .ks.kpage[data-kst] {
  height: var(--kscreen, 100svh); min-height: 480px; overflow: hidden;
}
html.kp-narrow .ks.kpage[data-kst] > .kframe {
  position: absolute !important; inset: 0; width: auto !important; height: auto !important;
  padding: 0 !important; margin: 0 !important; display: block !important; transform: none !important;
}
/* the headline on top; the rest of the words wait for the closing card */
html.kp-narrow [data-kst] [data-kps-part="copy"] {
  position: absolute !important; left: 0; right: 0; top: 0; z-index: 4; width: auto !important; height: auto !important;
  margin: 0 !important; padding: 74px 20px 30px !important; display: block !important; transform: none !important;
  background: linear-gradient(180deg, var(--kps-sky, rgba(255,250,240,.94)) 0%, var(--kps-sky, rgba(255,250,240,.94)) 55%, transparent 100%);
  pointer-events: none;
}
html.kp-narrow .ks.dark[data-kst] [data-kps-part="copy"] { --kps-sky: rgba(10,22,28,.9); }
html.kp-narrow [data-kst] [data-kps-part="copy"] > *:not(.eyebrow):not(.h2):not(h2) { display: none !important; }
html.kp-narrow [data-kst] [data-kps-part="copy"] .eyebrow { margin: 0 0 8px !important; }
html.kp-narrow [data-kst] [data-kps-part="copy"] .h2 { font-size: 28px !important; line-height: 1.1 !important; margin: 0 !important; max-width: 340px; }
html.kp-narrow [data-kst] [data-kps-part="hide"] { display: none !important; }
/* the scene: its design size, moved by the camera */
html.kp-narrow [data-kst] [data-kps-part="art"] {
  position: absolute !important; left: 0 !important; top: 0 !important; right: auto !important; bottom: auto !important;
  width: var(--aw) !important; height: var(--ah) !important; margin: 0 !important; zoom: 1 !important; max-width: none !important;
  overflow: visible !important; order: 0;
  transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(var(--ss, 1)) !important; transform-origin: 0 0 !important;
  transition: transform var(--camtr, 1000ms) cubic-bezier(.3,.7,.2,1) !important;
}

/* ---- the layer over the scene ---- */
.kps { display: none; }
.kps.kps-snap, .kps.kps-snap * { transition: none !important; }
html.kp-narrow [data-kst] .kps { display: block; position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.kps-dim { position: absolute; inset: 0; background: rgba(8,20,26,.46); opacity: 0; transition: opacity .45s; }
.kps-reveal { position: absolute; inset: 0; }
.kps-phone { position: absolute; left: 50%; top: max(92px, calc((100% - var(--kbar, 0px)) / 2 - 300px)); width: 262px; height: 566px; margin-left: -131px;
  border-radius: 40px; background: #0F1D22; padding: 9px; box-sizing: border-box;
  box-shadow: 0 0 0 2px #2A3F4D, 0 30px 70px rgba(0,0,0,.45); }
.kps-scr { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #F4FAFB; }
.kps-scr video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* rise: up from the bottom over the dimmed scene, and back down */
.kps.via-rise .kps-phone { transform: translateY(110vh); transition: transform .52s cubic-bezier(.3,.8,.2,1); }
[data-kps-phone] .kps.via-rise .kps-phone { transform: none; }
/* hand: out of the person's hand, and back into it */
.kps.via-hand .kps-phone { opacity: 0; transform: translate(var(--hx, 0px), var(--hy, 0px)) scale(.08);
  transition: transform .56s cubic-bezier(.3,.8,.2,1), opacity .22s .06s; }
[data-kps-phone] .kps.via-hand .kps-phone { opacity: 1; transform: none; transition: transform .56s cubic-bezier(.3,.8,.2,1), opacity .14s; }
/* circle: a circle opens from the person onto the app, and closes back */
.kps.via-circle .kps-reveal { background: radial-gradient(120% 80% at 50% 30%, #12404A 0%, #0A1F26 70%);
  clip-path: circle(0px at var(--ox) var(--oy)); transition: clip-path .62s cubic-bezier(.4,0,.2,1); }
[data-kps-phone] .kps.via-circle .kps-reveal { clip-path: circle(150vh at var(--ox) var(--oy)); }
/* stack: the scene steps back into a card, the phone comes forward over it */
html.kp-narrow [data-kst] > .kframe { transition: transform .55s cubic-bezier(.3,.7,.2,1), border-radius .55s, filter .55s; transform-origin: 50% 40%; }
html.kp-narrow [data-kst][data-kps-phone][data-kps-stack] > .kframe { transform: scale(.86) translateY(-3%) !important; border-radius: 28px; overflow: hidden; filter: brightness(.6) saturate(.8); }
.kps.via-stack .kps-phone { transform: translateY(110vh) scale(.96); transition: transform .55s cubic-bezier(.3,.8,.2,1); }
[data-kps-phone] .kps.via-stack .kps-phone { transform: none; }
[data-kps-phone] .kps.via-rise .kps-dim, [data-kps-phone] .kps.via-hand .kps-dim { opacity: 1; }

/* ---- the step line ---- */
.kps-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 20px calc(max(22px, env(safe-area-inset-bottom)) + var(--kbar, 0px));
  background: linear-gradient(0deg, rgba(10,22,28,.8) 0%, rgba(10,22,28,.52) 62%, rgba(10,22,28,0) 100%); color: #fff;
  transition: opacity .4s; font-family: var(--font, 'Lama Sans', system-ui, sans-serif); }
.kps-segs { display: flex; gap: 5px; margin-bottom: 10px; }
.kps-segs i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); position: relative; overflow: hidden; }
.kps-segs i.ph { flex: 1.4; background: rgba(11,186,216,.35); }
.kps-segs i::after { content: ''; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.kps[dir="rtl"] .kps-segs i::after, [dir="rtl"] .kps-segs i::after { transform-origin: 100% 50%; }
.kps-segs i.ph::after { background: #0BBAD8; }
.kps-segs i.full::after { transform: none; }
.kps-segs i.on::after { animation: kps-fill var(--d, 3000ms) linear forwards; }
@keyframes kps-fill { to { transform: none; } }
.kps-line { display: flex; align-items: center; gap: 10px; min-height: 46px; font-weight: 800; font-size: 17px; line-height: 1.3; }
.kps-line.swap { animation: kps-swap .35s ease both; }
@keyframes kps-swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.kps-ic { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.16); }
.kps-line.ph .kps-ic { background: #0BBAD8; color: #04242B; }
.kps-ic svg { width: 16px; height: 16px; }
/* on the last page the bar stays (tap back), the step line gives way to the page */
[data-kps-ended] .kps-line { display: none; }
[data-kps-ended] .kps-cap { background: none; z-index: 3; }
.kps-segs i.end { flex: .7; }
.kps-segs i.end::after { background: #fff; }

/* ---- the last page: the section's words, full screen over the blurred scene ---- */
.kps-end { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 88px 22px calc(52px + var(--kbar, 0px) + env(safe-area-inset-bottom)); box-sizing: border-box;
  opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s linear .5s; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,18,24,.35) 0%, rgba(6,18,24,.72) 38%, rgba(6,18,24,.9) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
  font-family: var(--font, 'Lama Sans', system-ui, sans-serif); color: #fff; }
[data-kps-ended] .kps-end { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .5s, visibility 0s; }
/* the headline moves from the top into the page */
html.kp-narrow [data-kst][data-kps-ended] [data-kps-part="copy"] { opacity: 0; transition: opacity .3s; }
.kps-card { max-height: 100%; overflow: auto; }
.kps-card > * { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .55s cubic-bezier(.3,.8,.2,1); }
[data-kps-ended] .kps-card > * { opacity: 1; transform: none; }
[data-kps-ended] .kps-card > :nth-child(2) { transition-delay: .06s; }
[data-kps-ended] .kps-card > :nth-child(3) { transition-delay: .12s; }
[data-kps-ended] .kps-card > :nth-child(4) { transition-delay: .18s; }
[data-kps-ended] .kps-card > :nth-child(5) { transition-delay: .24s; }
.kps-card .kps-eb { margin: 0 0 10px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: #7FE3F2; }
.kps-card .kps-eb::before { content: ''; width: 18px; height: 3px; border-radius: 2px; background: #0BBAD8; }
.kps-card h3 { margin: 0 0 14px; font-size: 32px; line-height: 1.08; font-weight: 800; letter-spacing: -.01em; }
.kps-card .kps-lead { margin: 0 0 16px; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.82); }
.kps-card ul { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 10px; }
.kps-card li { position: relative; padding-inline-start: 30px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.kps-card li::before { content: ''; position: absolute; inset-inline-start: 0; top: .05em; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(11,186,216,.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%237FE3F2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.kps-btns { display: flex; gap: 10px; }
.kps-btns button { flex: 1; min-height: 54px; padding: 0 14px; border: 0; border-radius: 27px; font: 800 15.5px/1.15 var(--font, 'Lama Sans', system-ui, sans-serif);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; -webkit-tap-highlight-color: transparent; }
.kps-btns .kps-again { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.45); flex: .85; }
.kps-btns .kps-try { background: #0BBAD8; color: #04242B; box-shadow: 0 10px 26px rgba(11,186,216,.35); }
.kps-btns button:active { transform: scale(.98); }
.kps-btns svg { width: 18px; height: 18px; flex: none; }

/* ---- the first story of a visit: how to move through it ---- */
.kps-hint { position: absolute; left: 50%; bottom: calc(118px + var(--kbar, 0px) + env(safe-area-inset-bottom)); transform: translate(-50%, 8px);
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 22px; white-space: nowrap;
  background: rgba(10,22,28,.82); color: #fff; font: 700 14px/1.2 var(--font, 'Lama Sans', system-ui, sans-serif);
  opacity: 0; transition: opacity .4s, transform .4s; pointer-events: none; }
.kps.kps-hinting .kps-hint { opacity: 1; transform: translate(-50%, 0); }
.kps-hint i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.18); position: relative; }
.kps-hint i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; }
.kps-hint-l::after { transform: translate(-30%, -50%) rotate(135deg); }
.kps-hint-r::after { transform: translate(-70%, -50%) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .kps-card > * { transition: none; } }

@media (prefers-reduced-motion: reduce) {
  html.kp-narrow [data-kst] [data-kps-part="art"], .kps *, .kps { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* small phones: the headline stays within two lines */
@media (max-width: 379px) {
  html.kp-narrow [data-kst] [data-kps-part="copy"] { padding-top: 70px !important; }
  html.kp-narrow [data-kst] [data-kps-part="copy"] .h2 { font-size: 24px !important; }
  .kps-line { font-size: 15.5px; }
}
